Skip to content
Snippets Groups Projects
Commit b837bbdd authored by Nicolas Martinelli's avatar Nicolas Martinelli Committed by Nicolas Martinelli
Browse files

[FIX] mass_mailing: unsubscribe if trailing '/'

If the `web.base.url` contains a trailing `/`, the replacement of the
`/unsubscribe_from_list` link won't work since the string to replace
will be `my_url//unsubscribe_from_list` instead of
`my_url/unsubscribe_from_list`.

Fixes #24731
opw-1848572
parent 66a60c70
Branches
Tags
No related merge requests found
......@@ -95,6 +95,8 @@ class MailMail(osv.Model):
res = super(MailMail, self).send_get_email_dict(cr, uid, ids, partner, context=context)
mail = self.browse(cr, uid, ids[0], context=context)
base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
if base_url.endswith('/'):
base_url = base_url.rstrip('/')
if mail.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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment