[FIX] mass_mailing: unsubscribe link when testing the mailing

When testing a mass mailing before sending the mailing
to the contacts (which well, is always the case),
the local links were not replaced by absolute links,
and the override done on the method `send_get_email_dict`
to convert the link `/unsubscribe_from_list` to the actual
unsubscription link was not working, as it relied
on the absolute link.

opw-657982
This commit is contained in:
Denis Ledoux
2015-12-01 17:23:32 +01:00
parent 19fe77b7d7
commit 258c11a9a6
@@ -25,6 +25,8 @@ class TestMassMailing(osv.TransientModel):
test_emails = tools.email_split(wizard.email_to)
mail_ids = []
for test_mail in test_emails:
# Convert links in absolute URLs before the application of the shortener
self.pool['mail.mass_mailing'].write(cr, uid, [mailing.id], {'body_html': self.pool['mail.template']._replace_local_links(cr, uid, mailing.body_html, context)}, context=context)
mail_values = {
'email_from': mailing.email_from,
'reply_to': mailing.reply_to,