Skip to content
Snippets Groups Projects
Commit 7703f1fb authored by Nicolas Lempereur's avatar Nicolas Lempereur
Browse files

[FIX] mass_mailing: have unsubscribe in multi lang


Since 953a693d link not corresponding to a route are tought multilang
by default.

Thus in the mass mailing, if the user had not the default language on
the website he would have eg. a /fr_FR/unsubscribe_from_list placeholder
in the mail.

The placeholder is replaced by a real link pinpointing to the items the
given person would unsubscribe to, but having /fr_FR/ part prevented
that.

With this PR, there is a dummy route so /unsubscribe_from_list is
explicitely known as not multilang.

opw-1850696
closes #24912

Co-authored-by: default avatarGoffin Simon <sig@odoo.com>
parent 2ca72960
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,11 @@ from odoo.tools import consteq
class MassMailController(http.Controller):
@http.route(['/unsubscribe_from_list'], type='http', website=True, multilang=False, auth='public')
def unsubscribe_placeholder_link(self, **post):
"""Dummy route so placeholder is not prefixed by language, MUST have multilang=False"""
raise werkzeug.exceptions.NotFound()
@http.route(['/mail/mailing/<int:mailing_id>/unsubscribe'], type='http', website=True, auth='public')
def mailing(self, mailing_id, email=None, res_id=None, token="", **post):
mailing = request.env['mail.mass_mailing'].sudo().browse(mailing_id)
......
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