summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/models/mail_mail.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-03-11 12:42:48 +0000
committerThibault Delavallée <tde@odoo.com>2020-03-24 10:25:04 +0000
commitaaefa35e29f7e87e8e914cf1d9eb68af7d26464a (patch)
tree0835ddf9cea2ffebfa0ca441411b32e3fa1db502 /addons/mass_mailing/models/mail_mail.py
parent3d86a29aeb21c7e5812c988866117a495f20ebed (diff)
[MOV] link_tracker, various: more link shortening tools to mail.render.mixin
PURPOSE Move links shortening tools on mail.render.mixin to have rendering and post procesing tools available on that mixin. SPECIFICATIONS Move html and text links shortening methods on mail.render.mixin class. That way rendering and post processing is done in that mixin instead of being specific to link.tracker model. Indeed those methods are tools and not really business related methods. Future commits will improve the way mail and sms composer use the render mixin. This commit is therefore both a cleaning and preparing commit. LINKS Task ID 1963529 Community PR odoo/odoo#32397
Diffstat (limited to 'addons/mass_mailing/models/mail_mail.py')
-rw-r--r--addons/mass_mailing/models/mail_mail.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py
index 68a653a38db..d35ae72f4be 100644
--- a/addons/mass_mailing/models/mail_mail.py
+++ b/addons/mass_mailing/models/mail_mail.py
@@ -6,8 +6,6 @@ import werkzeug.urls
from odoo import api, fields, models, tools
-from odoo.addons.link_tracker.models.link_tracker import URL_REGEX
-
class MailMail(models.Model):
"""Add the mass mailing campaign data to mail"""
@@ -54,7 +52,7 @@ class MailMail(models.Model):
body = super(MailMail, self)._send_prepare_body()
if self.mailing_id and body and self.mailing_trace_ids:
- for match in re.findall(URL_REGEX, self.body_html):
+ for match in re.findall(tools.URL_REGEX, self.body_html):
href = match[0]
url = match[1]