diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-01-29 13:17:12 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-01-29 13:17:12 +0100 |
| commit | cd5c8a02f9560b2a8b5c39182adee7ade1bf595c (patch) | |
| tree | c654b3d46020aa30fcc7c2724d200a93a807859b /addons/mass_mailing/models/mail_template.py | |
| parent | 6c6ef6588fc374e86acdeeacba2842690b6f1a53 (diff) | |
| parent | 36d96e015032d42449fe149c050df75050276fdc (diff) | |
[MERGE] forward port branch 11.0 up to 36d96e01503
Diffstat (limited to 'addons/mass_mailing/models/mail_template.py')
| -rw-r--r-- | addons/mass_mailing/models/mail_template.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/addons/mass_mailing/models/mail_template.py b/addons/mass_mailing/models/mail_template.py new file mode 100644 index 00000000000..68005ee0d10 --- /dev/null +++ b/addons/mass_mailing/models/mail_template.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import api, models + + +class MailTemplate(models.Model): + _inherit = "mail.template" + + @api.model + def render_post_process(self, html): + # super will transform relative url to absolute + html = super(MailTemplate, self).render_post_process(html) + + # apply shortener after + if self.env.context.get('post_convert_links'): + html = self.env['link.tracker'].convert_links( + html, + self.env.context['post_convert_links'], + blacklist=['/unsubscribe_from_list'] + ) + return html |
