diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-07-19 16:21:12 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-07-19 16:21:12 +0200 |
| commit | b857fd4c905c39c187fff2e533e5ff6714a4aec0 (patch) | |
| tree | a673c4a8136eb55e6dd55089c0ad3103af8c3d4a /addons/mass_mailing/models/mail_mail.py | |
| parent | c0bdf81a5be6a927135c480cdcbf8f9218033914 (diff) | |
| parent | 11270336fa7dd225bf03fc664d80b1604d4cbc4b (diff) | |
[MERGE] forward port branch 10.0 up to 11270336fa7
Diffstat (limited to 'addons/mass_mailing/models/mail_mail.py')
| -rw-r--r-- | addons/mass_mailing/models/mail_mail.py | 7 |
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 3a69530db1a..5c4f68b5597 100644 --- a/addons/mass_mailing/models/mail_mail.py +++ b/addons/mass_mailing/models/mail_mail.py @@ -61,15 +61,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) |
