Commits

Raimon Esteve (Zikzakmedia)  committed 0767cc6

Add signature if template and user have signature

  • Participants
  • Parent commits c5e6b25

Comments (0)

Files changed (2)

+* 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)
             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'))