diff options
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 |
