[MERGE] forward port branch saas-6 up to 3228694bdd

This commit is contained in:
Christophe Simonis
2017-07-18 19:18:59 +02:00
+3 -4
View File
@@ -62,15 +62,14 @@ class MailMail(osv.Model):
body = super(MailMail, self).send_get_mail_body(cr, uid, ids, partner=partner, context=context)
mail = self.browse(cr, uid, ids[0], context=context)
links_blacklist = ['/unsubscribe_from_list']
if mail.mailing_id and body and mail.statistics_ids:
for match in re.findall(URL_REGEX, mail.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(mail.statistics_ids[0].id))
body = body.replace(href, new_href)