diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index d540971c3b4..3c124f740f4 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -29,7 +29,7 @@ from osv import fields import tools from tools.translate import _ from tools.html_sanitize import html_sanitize -from tools import html2plaintext +from tools import html2plaintext, append_content_to_html from urllib import quote as quote _logger = logging.getLogger(__name__) @@ -322,13 +322,12 @@ class email_template(osv.osv): template.model, res_id, context=context) \ or False - if values['body_html']: - values['body'] = html_sanitize(values['body_html']) - values['body_text'] = html2plaintext(values['body_html']) - if template.user_signature: signature = self.pool.get('res.users').browse(cr, uid, uid, context).signature - values['body'] += '\n\n' + signature + values['body_html'] = append_content_to_html(values['body_html'], signature) + + if values['body_html']: + values['body'] = html_sanitize(values['body_html']) values.update(mail_server_id = template.mail_server_id.id or False, auto_delete = template.auto_delete, diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index 11e726c537b..a6fb2a00646 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -100,8 +100,6 @@ class mail_compose_message(osv.osv_memory): values.update(use_template=use_template, template_id=template_id) - print 'returning ', values - return {'value': values} def toggle_template(self, cr, uid, ids, context=None): diff --git a/addons/mail/mail_followers.py b/addons/mail/mail_followers.py index 9646744fae8..9205aa0b933 100644 --- a/addons/mail/mail_followers.py +++ b/addons/mail/mail_followers.py @@ -98,12 +98,7 @@ class mail_notification(osv.Model): body_html = msg.body signature = msg.author_id and msg.author_id.user_ids[0].signature or '' if signature: - signature_block = u'\n
%s\n' % signature - insertion_point = body_html.find('