[MERGE] forward port branch 9.0 up to 0046bf7292
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user