Commits

Raimon Esteve (Zikzakmedia)  committed 13efcb9

Add signature template email

  • Participants
  • Parent commits 111f223

Comments (0)

Files changed (3)

+* Add signature template email
 * Report filename. File name expresion available in each report
 * Mimetype from filename+extension
 * Add extension report file
             'model': Eval('model'),
             'email_template': True,
             })
+    signature =  fields.Boolean('Use Signature',
+        help='The signature from the User details will be appened to the mail.')
 
     def __init__(self):
         super(Template, self).__init__()
             # HTML & Text Alternate parts
             plain = self.eval(template, template.plain, record)
             html = self.eval(template, template.html, record)
+            if template.signature:
+                user_obj = Pool().get('res.user')
+                user = user_obj.browse(Transaction().user)
+                signature = user.signature.encode("ASCII", 'ignore')
+                plain = '%s\n--\n%s' % (plain, signature)
+                html = '%s<br>--<br>%s' % (plain, signature.replace('\n', '<br>'))
             message.attach(MIMEText(plain, 'plain'))
             message.attach(MIMEText(html, 'html'))
 

File template.xml

               <field name="mailbox"/>
               <label name="subject"/>
               <field name="subject"/>
+              <label name="signature"/>
+              <field name="signature"/>
             </group>
             <group colspan="2" id="body_text">
               <separator name="plain" colspan="4"/>