summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/models/mail_mail.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-07-20 11:48:49 +0200
committerChristophe Simonis <chs@odoo.com>2017-07-20 11:48:49 +0200
commitfa3e89064a503c95ab2b283e5d5b39ca182f8f47 (patch)
treed638f0cb99fc973169d670ff0bafd1b9474b4771 /addons/mass_mailing/models/mail_mail.py
parent0ae679e433ee4c5ca32ae1302d87d7fb33e0c78d (diff)
parent104dfe3c07d36a6487f045f31d0999cc429cb5bb (diff)
[MERGE] forward port branch saas-16 up to 104dfe3c07d
Diffstat (limited to 'addons/mass_mailing/models/mail_mail.py')
-rw-r--r--addons/mass_mailing/models/mail_mail.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py
index 1772cdaf1ff..e5072060fd5 100644
--- a/addons/mass_mailing/models/mail_mail.py
+++ b/addons/mass_mailing/models/mail_mail.py
@@ -60,15 +60,14 @@ class MailMail(models.Model):
self.ensure_one()
body = super(MailMail, self).send_get_mail_body(partner=partner)
- links_blacklist = ['/unsubscribe_from_list']
-
if self.mailing_id and body and self.statistics_ids:
for match in re.findall(URL_REGEX, self.body_html):
-
href = match[0]
url = match[1]
- if not [s for s in links_blacklist if s in href]:
+ parsed = urlparse.urlparse(url, scheme='http')
+
+ if parsed.scheme.startswith('http') and parsed.path.startswith('/r/'):
new_href = href.replace(url, url + '/m/' + str(self.statistics_ids[0].id))
body = body.replace(href, new_href)