[IMP] mass_mailing_custom_unsubscribe: pre-commit auto fixes

pull/1420/head
David 2024-07-08 08:37:05 +02:00
parent f2bbf5e1a0
commit b4b2f6e5a0
14 changed files with 127 additions and 122 deletions

View File

@ -17,28 +17,28 @@ Customizable unsubscription process on mass mailing emails
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/16.0/mass_mailing_custom_unsubscribe
:target: https://github.com/OCA/social/tree/17.0/mass_mailing_custom_unsubscribe
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mass_mailing_custom_unsubscribe
:target: https://translation.odoo-community.org/projects/social-17-0/social-17-0-mass_mailing_custom_unsubscribe
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=17.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This addon extends the unsubscription form to let you:
- Choose which mailing lists are not cross-unsubscriptable when unsubscribing
from a different one.
- Know why and when a contact has been subscribed or unsubscribed from a
mass mailing.
- Provide proof on why you are sending mass mailings to a given contact, as
required by the GDPR in Europe.
- Handle discrete unsubscriptions from other recipients that are not a mailing
list. On standard module, unsubscriptions from these recipients directly
include that mail on the general blacklist.
- Choose which mailing lists are not cross-unsubscriptable when
unsubscribing from a different one.
- Know why and when a contact has been subscribed or unsubscribed from
a mass mailing.
- Provide proof on why you are sending mass mailings to a given
contact, as required by the GDPR in Europe.
- Handle discrete unsubscriptions from other recipients that are not a
mailing list. On standard module, unsubscriptions from these
recipients directly include that mail on the general blacklist.
**Table of contents**
@ -48,42 +48,43 @@ This addon extends the unsubscription form to let you:
Configuration
=============
You can customize what reasons will be displayed to your unsubscriptors when
they are going to unsubscribe. To do it:
You can customize what reasons will be displayed to your unsubscriptors
when they are going to unsubscribe. To do it:
#. Go to *Email Marketing > Configuration > Unsubscription Reasons*.
#. Create / edit / remove / sort as usual.
#. If *Details required* is enabled, they will have to fill a text area to
continue.
1. Go to *Email Marketing > Configuration > Unsubscription Reasons*.
2. Create / edit / remove / sort as usual.
3. If *Details required* is enabled, they will have to fill a text area
to continue.
For having discrete unsubscriptions from other recipients than the mailing
lists, you need to add a glue module that adds 2 fields in the associated
model:
For having discrete unsubscriptions from other recipients than the
mailing lists, you need to add a glue module that adds 2 fields in the
associated model:
- `opt_out`.
- Either `email` or `email_from`.
- opt_out.
- Either email or email_from.
See `mass_mailing_custom_unsubscribe_event` for an example.
See mass_mailing_custom_unsubscribe_event for an example.
Usage
=====
Once configured:
#. Go to *Email Marketing > Mailings > Create*.
#. Edit your mass mailing at wish, but remember to add a snippet from
1. Go to *Email Marketing > Mailings > Create*.
2. Edit your mass mailing at wish, but remember to add a snippet from
*Footers*, so people have an *Unsubscribe* link.
#. Send it.
#. If somebody gets unsubscribed, you will see logs about that under
3. Send it.
4. If somebody gets unsubscribed, you will see logs about that under
*Email Marketing > Unsubscriptions*.
Known issues / Roadmap
======================
* This module replaces AJAX submission core implementation from the mailing
list management form, because it is impossible to extend it. When this is
fixed, this addon will need a refactoring (mostly removing
duplicated functionality and depending on it instead of replacing it).
- This module replaces AJAX submission core implementation from the
mailing list management form, because it is impossible to extend it.
When this is fixed, this addon will need a refactoring (mostly
removing duplicated functionality and depending on it instead of
replacing it).
Bug Tracker
===========
@ -91,7 +92,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mass_mailing_custom_unsubscribe%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mass_mailing_custom_unsubscribe%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@ -99,26 +100,26 @@ Credits
=======
Authors
~~~~~~~
-------
* Tecnativa
Contributors
~~~~~~~~~~~~
------------
* `Tecnativa <https://www.tecnativa.com>`_:
- `Tecnativa <https://www.tecnativa.com>`__:
* Rafael Blasco
* Antonio Espinosa
* Jairo Llopis
* David Vidal
* Ernesto Tejeda
* Pedro M. Baeza
* Carlos Roca
* Pilar Vargas
- Rafael Blasco
- Antonio Espinosa
- Jairo Llopis
- David Vidal
- Ernesto Tejeda
- Pedro M. Baeza
- Carlos Roca
- Pilar Vargas
Maintainers
~~~~~~~~~~~
-----------
This module is maintained by the OCA.
@ -130,6 +131,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/social <https://github.com/OCA/social/tree/16.0/mass_mailing_custom_unsubscribe>`_ project on GitHub.
This module is part of the `OCA/social <https://github.com/OCA/social/tree/17.0/mass_mailing_custom_unsubscribe>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -146,7 +146,7 @@ class CustomUnsubscribe(MassMailController):
# redefinition of _add and _remove methods of the mail.blacklist class
extra_context = {
"default_metadata": "\n".join(
"{}: {}".format(val, environ.get(val))
f"{val}: {environ.get(val)}"
for val in ("REMOTE_ADDR", "HTTP_USER_AGENT", "HTTP_ACCEPT_LANGUAGE")
),
"mailing_id": mailing_id,

View File

@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@ -0,0 +1,16 @@
You can customize what reasons will be displayed to your unsubscriptors
when they are going to unsubscribe. To do it:
1. Go to *Email Marketing \> Configuration \> Unsubscription Reasons*.
2. Create / edit / remove / sort as usual.
3. If *Details required* is enabled, they will have to fill a text area
to continue.
For having discrete unsubscriptions from other recipients than the
mailing lists, you need to add a glue module that adds 2 fields in the
associated model:
- opt_out.
- Either email or email_from.
See mass_mailing_custom_unsubscribe_event for an example.

View File

@ -1,16 +0,0 @@
You can customize what reasons will be displayed to your unsubscriptors when
they are going to unsubscribe. To do it:
#. Go to *Email Marketing > Configuration > Unsubscription Reasons*.
#. Create / edit / remove / sort as usual.
#. If *Details required* is enabled, they will have to fill a text area to
continue.
For having discrete unsubscriptions from other recipients than the mailing
lists, you need to add a glue module that adds 2 fields in the associated
model:
- `opt_out`.
- Either `email` or `email_from`.
See `mass_mailing_custom_unsubscribe_event` for an example.

View File

@ -0,0 +1,9 @@
- [Tecnativa](https://www.tecnativa.com):
- Rafael Blasco
- Antonio Espinosa
- Jairo Llopis
- David Vidal
- Ernesto Tejeda
- Pedro M. Baeza
- Carlos Roca
- Pilar Vargas

View File

@ -1,10 +0,0 @@
* `Tecnativa <https://www.tecnativa.com>`_:
* Rafael Blasco
* Antonio Espinosa
* Jairo Llopis
* David Vidal
* Ernesto Tejeda
* Pedro M. Baeza
* Carlos Roca
* Pilar Vargas

View File

@ -0,0 +1,11 @@
This addon extends the unsubscription form to let you:
- Choose which mailing lists are not cross-unsubscriptable when
unsubscribing from a different one.
- Know why and when a contact has been subscribed or unsubscribed from a
mass mailing.
- Provide proof on why you are sending mass mailings to a given contact,
as required by the GDPR in Europe.
- Handle discrete unsubscriptions from other recipients that are not a
mailing list. On standard module, unsubscriptions from these
recipients directly include that mail on the general blacklist.

View File

@ -1,11 +0,0 @@
This addon extends the unsubscription form to let you:
- Choose which mailing lists are not cross-unsubscriptable when unsubscribing
from a different one.
- Know why and when a contact has been subscribed or unsubscribed from a
mass mailing.
- Provide proof on why you are sending mass mailings to a given contact, as
required by the GDPR in Europe.
- Handle discrete unsubscriptions from other recipients that are not a mailing
list. On standard module, unsubscriptions from these recipients directly
include that mail on the general blacklist.

View File

@ -0,0 +1,5 @@
- This module replaces AJAX submission core implementation from the
mailing list management form, because it is impossible to extend it.
When this is fixed, this addon will need a refactoring (mostly
removing duplicated functionality and depending on it instead of
replacing it).

View File

@ -1,4 +0,0 @@
* This module replaces AJAX submission core implementation from the mailing
list management form, because it is impossible to extend it. When this is
fixed, this addon will need a refactoring (mostly removing
duplicated functionality and depending on it instead of replacing it).

View File

@ -0,0 +1,8 @@
Once configured:
1. Go to *Email Marketing \> Mailings \> Create*.
2. Edit your mass mailing at wish, but remember to add a snippet from
*Footers*, so people have an *Unsubscribe* link.
3. Send it.
4. If somebody gets unsubscribed, you will see logs about that under
*Email Marketing \> Unsubscriptions*.

View File

@ -1,8 +0,0 @@
Once configured:
#. Go to *Email Marketing > Mailings > Create*.
#. Edit your mass mailing at wish, but remember to add a snippet from
*Footers*, so people have an *Unsubscribe* link.
#. Send it.
#. If somebody gets unsubscribed, you will see logs about that under
*Email Marketing > Unsubscriptions*.

View File

@ -368,18 +368,18 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3cd60bd009ca6770a962ab0284115db4c24a67db1644f355bd289190843a520d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/social/tree/16.0/mass_mailing_custom_unsubscribe"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/social-16-0/social-16-0-mass_mailing_custom_unsubscribe"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/social&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/social/tree/17.0/mass_mailing_custom_unsubscribe"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/social-17-0/social-17-0-mass_mailing_custom_unsubscribe"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/social&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon extends the unsubscription form to let you:</p>
<ul class="simple">
<li>Choose which mailing lists are not cross-unsubscriptable when unsubscribing
from a different one.</li>
<li>Know why and when a contact has been subscribed or unsubscribed from a
mass mailing.</li>
<li>Provide proof on why you are sending mass mailings to a given contact, as
required by the GDPR in Europe.</li>
<li>Handle discrete unsubscriptions from other recipients that are not a mailing
list. On standard module, unsubscriptions from these recipients directly
include that mail on the general blacklist.</li>
<li>Choose which mailing lists are not cross-unsubscriptable when
unsubscribing from a different one.</li>
<li>Know why and when a contact has been subscribed or unsubscribed from
a mass mailing.</li>
<li>Provide proof on why you are sending mass mailings to a given
contact, as required by the GDPR in Europe.</li>
<li>Handle discrete unsubscriptions from other recipients that are not a
mailing list. On standard module, unsubscriptions from these
recipients directly include that mail on the general blacklist.</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
@ -398,22 +398,22 @@ include that mail on the general blacklist.</li>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>You can customize what reasons will be displayed to your unsubscriptors when
they are going to unsubscribe. To do it:</p>
<p>You can customize what reasons will be displayed to your unsubscriptors
when they are going to unsubscribe. To do it:</p>
<ol class="arabic simple">
<li>Go to <em>Email Marketing &gt; Configuration &gt; Unsubscription Reasons</em>.</li>
<li>Create / edit / remove / sort as usual.</li>
<li>If <em>Details required</em> is enabled, they will have to fill a text area to
continue.</li>
<li>If <em>Details required</em> is enabled, they will have to fill a text area
to continue.</li>
</ol>
<p>For having discrete unsubscriptions from other recipients than the mailing
lists, you need to add a glue module that adds 2 fields in the associated
model:</p>
<p>For having discrete unsubscriptions from other recipients than the
mailing lists, you need to add a glue module that adds 2 fields in the
associated model:</p>
<ul class="simple">
<li><cite>opt_out</cite>.</li>
<li>Either <cite>email</cite> or <cite>email_from</cite>.</li>
<li>opt_out.</li>
<li>Either email or email_from.</li>
</ul>
<p>See <cite>mass_mailing_custom_unsubscribe_event</cite> for an example.</p>
<p>See mass_mailing_custom_unsubscribe_event for an example.</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
@ -430,10 +430,11 @@ model:</p>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>This module replaces AJAX submission core implementation from the mailing
list management form, because it is impossible to extend it. When this is
fixed, this addon will need a refactoring (mostly removing
duplicated functionality and depending on it instead of replacing it).</li>
<li>This module replaces AJAX submission core implementation from the
mailing list management form, because it is impossible to extend it.
When this is fixed, this addon will need a refactoring (mostly
removing duplicated functionality and depending on it instead of
replacing it).</li>
</ul>
</div>
<div class="section" id="bug-tracker">
@ -441,7 +442,7 @@ duplicated functionality and depending on it instead of replacing it).</li>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/social/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mass_mailing_custom_unsubscribe%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mass_mailing_custom_unsubscribe%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@ -475,7 +476,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/16.0/mass_mailing_custom_unsubscribe">OCA/social</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/17.0/mass_mailing_custom_unsubscribe">OCA/social</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>