sending mail with Plomino form

Developers
Giovanni
2011-11-10
2013-04-25
<< < 1 2 (Page 2 of 2)
  • Jean Jordaan
    Jean Jordaan
    2011-11-11

    What exactly are you passing?

     
  • Giovanni
    Giovanni
    2011-11-11

    Onsave this is the code:
    db = context.getParentDatabase()
    message = plominoDocument.getItem('Body')
    To = plominoDocument.getItem('To')
    mTo = userInfo(db, To).getProperty('email')
    mFrom = db.portal_properties.site_properties.email_from_address
    mSubject = plominoDocument.getItem('Topic')
    sendMail(db, mTo, mSubject, message, mFrom)

     
  • Jean Jordaan
    Jean Jordaan
    2011-11-11

    I asked: what exactly are you passing? What literal value are you passing?

    I see you have `userInfo(db, To).getProperty('email')`.
    If `To` is a list, does that make sense?
    See http://www.plomino.net/doc/classes.html?highlight=userinfo

     
  • Giovanni
    Giovanni
    2011-11-14

    The following code works:

    db = context.getParentDatabase()
    message = plominoDocument.getItem('Body')
    To = plominoDocument.getItem('To')
    mTo = ''
    for i in To:

         mTo += userInfo(db, i).getProperty('email')+';'

    mFrom = db.portal_properties.site_properties.email_from_address
    mSubject = plominoDocument.getItem('Topic')
    sendMail(db, mTo, mSubject, message, mFrom)

    Thanks.
    Bye

     
  • Al  Lun
    Al Lun
    2012-04-10

    These instructions have been very helpful.  I have an additional question:

    How do I include the url of the saved document in the email?

     
  • Robert
    Robert
    2012-04-11

    You can add this code in the message

        message = """This is the url of your document: <a href="%s">URL</a>""" % plominoDocument.absolute_url()
    
     
<< < 1 2 (Page 2 of 2)