From 258c11a9a6fa00a83070de750ab19a916734d040 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 1 Dec 2015 17:20:35 +0100 Subject: [PATCH] [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 --- addons/mass_mailing/wizard/test_mailing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mass_mailing/wizard/test_mailing.py b/addons/mass_mailing/wizard/test_mailing.py index c0601ea29d5..b86f4ea32a0 100644 --- a/addons/mass_mailing/wizard/test_mailing.py +++ b/addons/mass_mailing/wizard/test_mailing.py @@ -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,