Skip to content
Snippets Groups Projects
Commit bc8f5c5e authored by Christophe Simonis's avatar Christophe Simonis
Browse files

[MERGE] forward port branch 9.0 up to 0046bf72

parents 2039753e 0046bf72
No related branches found
No related tags found
No related merge requests found
......@@ -87,12 +87,12 @@ class MailMail(models.Model):
def send_get_email_dict(self, partner=None):
# TDE: temporary addition (mail was parameter) due to semi-new-API
res = super(MailMail, self).send_get_email_dict(partner)
base_url = self.env['ir.config_parameter'].get_param('web.base.url')
base_url = self.env['ir.config_parameter'].get_param('web.base.url').rstrip('/')
if self.mailing_id and res.get('body') and res.get('email_to'):
emails = tools.email_split(res.get('email_to')[0])
email_to = emails and emails[0] or False
unsubscribe_url = self._get_unsubscribe_url(email_to)
link_to_replace = base_url+'/unsubscribe_from_list'
link_to_replace = base_url + '/unsubscribe_from_list'
if link_to_replace in res['body']:
res['body'] = res['body'].replace(link_to_replace, unsubscribe_url if unsubscribe_url else '#')
return res
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment