1. zikzakmedia
  2. trytond-electronic_mail_template

Commits

Raimon Esteve (Zikzakmedia)  committed 0767cc6

Add signature if template and user have signature

  • Participants
  • Parent commits c5e6b25
  • Branches default

Comments (0)

Files changed (2)

File CHANGELOG

View file
+* Add signature if template and user have signature
 * Add event if party_event is installed
 * Available Send Email by user (button)
 * Usability: Access Template user email group (menu & rule)

File template.py

View file
             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>'))
+                if user.signature:
+                    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'))