summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/wizard
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-02-08 16:08:59 +0100
committerThibault Delavallée <tde@odoo.com>2018-02-12 13:07:41 +0100
commitb1b9896c46e98567bd68b489b365aebf5f98f2b5 (patch)
tree9c9e267efb82d1826c4807acbf9125d0dcc7a3fd /addons/mass_mailing/wizard
parent94f2f6241b65c746baf13adaf5f60567877acc06 (diff)
[FIX] mail: replace local links in notification emails
Since notification emails are not mail templates anymore they do not go through the mail_template.render_post_process() method that converts local links to absolute links. This means that buttons and images were not correctly displayed in notification emails. Indeed those still had local links. This commit fixes that by moving the method directly in mail.thread and calling it accordingly when rendering the notification email. Note that the method has been changed in order to use regex instead of html parser. It is done based on work already done in mass mailing application. Indeed using parsers is complex and time consuming and may create changes in the html structure that are not intended. Next step in master is to go through various link modifications in mass mailing module to see how to handle them properly. Maybe.
Diffstat (limited to 'addons/mass_mailing/wizard')
-rw-r--r--addons/mass_mailing/wizard/test_mailing.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mass_mailing/wizard/test_mailing.py b/addons/mass_mailing/wizard/test_mailing.py
index 24b395c7c53..f1231fd2b38 100644
--- a/addons/mass_mailing/wizard/test_mailing.py
+++ b/addons/mass_mailing/wizard/test_mailing.py
@@ -20,7 +20,7 @@ class TestMassMailing(models.TransientModel):
test_emails = tools.email_split(self.email_to)
for test_mail in test_emails:
# Convert links in absolute URLs before the application of the shortener
- mailing.write({'body_html': self.env['mail.template']._replace_local_links(mailing.body_html)})
+ mailing.write({'body_html': self.env['mail.thread']._replace_local_links(mailing.body_html)})
mail_values = {
'email_from': mailing.email_from,
'reply_to': mailing.reply_to,