mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-21 20:02:03 +02:00
19.0 vanilla
This commit is contained in:
parent
5df8c07b59
commit
daa394e8b0
2114 changed files with 564841 additions and 299642 deletions
|
|
@ -0,0 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import werkzeug
|
||||
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class MailingLegacy(http.Controller):
|
||||
""" Retro compatibility layer for legacy endpoint"""
|
||||
|
||||
@http.route(['/mail/mailing/<int:mailing_id>/unsubscribe'], type='http', website=True, auth='public')
|
||||
def mailing_unsubscribe(self, mailing_id, email=None, res_id=None, token="", **post):
|
||||
""" Old route, using mail/mailing prefix, and outdated parameter names """
|
||||
params = werkzeug.urls.url_encode(
|
||||
dict(**post, document_id=res_id, email=email, hash_token=token)
|
||||
)
|
||||
return request.redirect(
|
||||
f'/mailing/{mailing_id}/unsubscribe?{params}'
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue