diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index c8ce25def0b..eea3a7eb46f 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -200,9 +200,9 @@ class mail_compose_message(osv.TransientModel):
body_text = message_data.body_text or ''
body_html = message_data.body_html or ''
quoted_body_text = '> %s' % tools.ustr(body_text.replace('\n', "\n> ") or '')
- quoted_body_html = '\n
%s
' % (body_html),
+ quoted_body_html = '%s
' % {tools.ustr(body_html)},
reply_body_text = '\n%s%s\n%s\n%s' % (sent_date, sender, quoted_body_text, current_user.signature)
- reply_body_html = '\n%s%s\n%s\n%s' % (sent_date, sender, quoted_body_html, current_user.signature)
+ reply_body_html = '
%s%s
%s
%s' % (sent_date, sender, quoted_body_html, current_user.signature)
# form dest_partner_ids
dest_partner_ids = [partner.id for partner in message_data.partner_ids]
# Update header and references
@@ -210,12 +210,12 @@ class mail_compose_message(osv.TransientModel):
reply_references = message_data.references and tools.ustr(message_data.references) or False
reply_message_id = message_data.message_id or False
if reply_message_id:
- reply_references = (reply_references or '') + " " + mail_wiz.message_id
- reply_headers['In-Reply-To'] = mail_wiz.message_id
+ reply_references = (reply_references or '') + " " + message_data.message_id
+ reply_headers['In-Reply-To'] = message_data.message_id
# update the result
result.update({
'body_text': reply_body_text,
- 'body_html': quoted_body_html,
+ 'body_html': reply_body_html,
'subject': reply_subject,
'attachment_ids': [],
'dest_partner_ids': dest_partner_ids,