social/mass_mailing_custom_unsubscribe
Jairo Llopis 708780cab9 [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate.
- Imported last updates from v8.
- Adapted to v9.
- Added a saner default to `mass_mailing.salt` configuration parameter by
  reusing `database.secret` if available, hoping that some day
  https://github.com/odoo/odoo/pull/12040 gets merged.
- Updated README.
- Increase security, drop backwards compatibility.
  Security got improved upstream, which would again break compatibility among current addon and future master upstream.
  I choose to break it now and keep it secured future-wise, so I drop the backwards compatibility features.
- Includes tour tests.
- Removes outdated tests.
- Extends the mailing list management form when unsubscriber is a contact.
- Adds a reason form even if he is not.
- Avoids all methods that were not model-agnostic.

[FIX][mass_mailing_custom_unsubscribe] Reasons noupdate

After this fix, when you update the addon, you will not lose your customized reasons.

[FIX] Compatibilize with mass_mailing_partner

Current test code was based on the assumption that the `@api.model` decorator on `create()` ensured an empty recordset when running the method, but that's not true. This was causing an incompatibility betwee these tests and the `mass_mailing_partner` addon, which works assuming 0-1 recordsets.

Now records are created from an empty recordset, and thus tests work everywhere.

Update instructions

If the user does not add the unsubscribe snippet, nothing will happen, so it's added to README to avoid confusion when testing/using the addon.

[FIX] Use the right operator to preserve recordsets order

Using `|=` sorts records at will each time (treating them as Python's `set`).
Using `+=` always appends a record to the end of the set.
Since we are using the record position in the set, this caused the test to work sometimes and fail other times. Now it works always.
2022-12-16 13:13:16 +01:00
..
controllers [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
data [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
demo [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
i18n [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
images [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
models [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
security [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
static [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
templates [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
tests [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
views [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
__init__.py [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
__manifest__.py [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
exceptions.py [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00
README.rst [9.0][MIG][mass_mailing_custom_unsubscribe] Migrate. 2022-12-16 13:13:16 +01:00

.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
   :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
   :alt: License: AGPL-3

==========================================================
Customizable unsubscription process on mass mailing emails
==========================================================

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 as been unsubscribed from a mass mailing.

Configuration
=============

Unsubscription Reasons
----------------------

You can customize what reasons will be displayed to your unsubscriptors when
they are going to unsubscribe. To do it:

#. Go to *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.

Usage
=====

Once configured:

#. Go to *Mass Mailing > Mailings > Mass 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
   *Mass Mailing > Mailings > Unsubscriptions*.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
   :alt: Try me on Runbot
   :target: https://runbot.odoo-community.org/runbot/205/9.0

Known issues / Roadmap
======================

* This module adds a security hash for mass mailing unsubscription URLs, which
  disables insecure URLs from mass mailing messages sent before its
  installation. This can be a problem, but anyway you'd get that problem in
  Odoo 11.0, so at least this addon will be forward-compatible with it.
* This module replaces AJAX submission core implementation from the mailing
  list management form, because it is impossible to extend it. When
  https://github.com/odoo/odoo/pull/14386 gets merged (which upstreams most
  needed changes), this addon will need a refactoring (mostly removing
  duplicated functionality and depending on it instead of replacing it). In the
  mean time, there is a little chance that this introduces some
  incompatibilities with other addons that depend on ``website_mass_mailing``.

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 smashing it by providing a detailed and welcomed feedback.

Credits
=======

Contributors
------------

* Rafael Blasco <rafael.blasco@tecnativa.com>
* Antonio Espinosa <antonio.espinosa@tecnativa.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.