Skip to content

Conversation

@Shide
Copy link

@Shide Shide commented Nov 7, 2025

When unsubscribing from a list, you cannot select a reason until you go to the mailing list manager. Now, you can choose with a system parameter to redirect directly to the mailing list manager and give the user in the first place an option to select a reason to opt out.

https://www.loom.com/share/7801fec1afb24e1bb51c74b0c1fdbe1d

MT-12505 @moduon @yajo @EmilioPascual @chienandalu @rafaelbn please review if you want 😄

@rafaelbn rafaelbn added this to the 18.0 milestone Nov 7, 2025
Comment on lines 18 to 22
if (
request.env["ir.config_parameter"]
.sudo()
.get_param("mass_mailing.mailing_lists_unsubscribe_redirect", "0")
== "1"
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For booleans, it's simpler to just check if the param is there or not (and that's how it will work if you use it as a res.config.settings boolean config_parameter

Suggested change
if (
request.env["ir.config_parameter"]
.sudo()
.get_param("mass_mailing.mailing_lists_unsubscribe_redirect", "0")
== "1"
):
if (
request.env["ir.config_parameter"]
.sudo()
.get_param("mass_mailing.mailing_lists_unsubscribe_redirect")
):

Copy link
Member

@yajo yajo Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually you have odoo.tools.str2bool for this specific purpose.

Suggested change
if (
request.env["ir.config_parameter"]
.sudo()
.get_param("mass_mailing.mailing_lists_unsubscribe_redirect", "0")
== "1"
):
if str2bool(
request.env["ir.config_parameter"]
.sudo()
.get_param("mass_mailing.mailing_lists_unsubscribe_redirect", "0")
):

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you create the parameter but add no text to it, it will still be considered false, which goes against what the readme says.

I still suggest to use the str2bool approach. Otherwise, be more specific in the readme.

@Shide Shide force-pushed the 18.0-allow_redirect_to_maling_list_manager-mass_mailing_custom_unsubscribe branch 3 times, most recently from 480f6c9 to b6c8f24 Compare November 10, 2025 11:46
… manager on unsubscribe

When unsubscribing from a list, you cannot select a reason until you go to the mailing list manager.
Now, you can choose with a system parameter to redirect directly to the mailing list manager and give the user in the first place an option to select a reason to opt out.
@Shide Shide force-pushed the 18.0-allow_redirect_to_maling_list_manager-mass_mailing_custom_unsubscribe branch from b6c8f24 to 03e0185 Compare November 10, 2025 11:50
@Shide Shide requested review from chienandalu and yajo November 10, 2025 11:52
Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code and functional review 👍

Comment on lines 18 to 22
if (
request.env["ir.config_parameter"]
.sudo()
.get_param("mass_mailing.mailing_lists_unsubscribe_redirect", "0")
== "1"
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you create the parameter but add no text to it, it will still be considered false, which goes against what the readme says.

I still suggest to use the str2bool approach. Otherwise, be more specific in the readme.

@@ -0,0 +1,4 @@

In order to redirect direct unsubscriptions to the Mailing Subscriptions form,
you need to create the system parameter `mass_mailing.mailing_lists_unsubscribe_manager_redirect`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the docs I said above, that they are a bit misleading.

Suggested change
you need to create the system parameter `mass_mailing.mailing_lists_unsubscribe_manager_redirect`.
you need to create the system parameter `mass_mailing.mailing_lists_unsubscribe_manager_redirect` with value `1`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants