Jairo Llopis 99836513b9 [IMP] mail_tracking_mailgun: refactor to support modern webhooks
Before this patch, the module was designed after the [deprecated Mailgun webhooks][3]. However Mailgun had the [events API][2] which was quite different. Modern Mailgun has deprecated those webhooks and instead uses new ones that include the same payload as the events API, so you can reuse code.

However, this was incorrectly reusing the code inversely: trying to process the events API through the same code prepared for the deprecated webhooks.

Besides, both `failed` and `rejected` mailgun events were mapped to `error` state, but that was also wrong because [`mail_tracking` doesn't have an `error` state][1].

So the logic of the whole module is changed, adapting it to process the events API payload, both through controllers (prepared for the new webhooks) and manual updates that directly call the events API.

Also, `rejected` is now translated into `reject`, and `failed` is translated into `hard_bounce` or `soft_bounce` depending on the severity, as specified by [mailgun docs][2]. Also, `bounced` and `dropped` mailgun states are removed because they don't exist, and instead `failed` and `rejected` properly get their metadata.

Of course, to know the severity, now the method to obtain that info must change, it' can't be a simple dict anymore.

Added more parameters because for example modern Mailgun uses different keys for signing payload than for accessing the API. As there are so many parameters, configuration is now possible through `res.config.settings`. Go there to autoregister webhooks too.

Since the new webhooks are completely incompatible with the old supposedly-abstract webhooks controllers (that were never really that abstract), support for old webhooks is removed, and it will be removed in the future from `mail_tracking` directly. There is a migration script that attempts to unregister old webhooks and register new ones automatically.

[1]: f73de421e2/mail_tracking/models/mail_tracking_event.py (L31-L42)
[2]: https://documentation.mailgun.com/en/latest/api-events.html#event-types
[3]: https://documentation.mailgun.com/en/latest/api-webhooks-deprecated.html
2022-05-17 17:16:14 -03:00
2021-12-06 14:59:57 +00:00
2022-01-21 10:56:04 +00:00
2021-12-06 14:54:54 +00:00
2022-04-07 19:32:20 +00:00
2022-02-17 15:24:00 +00:00
2022-05-11 20:56:49 +00:00
2022-05-11 20:56:49 +00:00
2021-10-17 17:07:28 +02:00
2022-03-31 17:46:11 +02:00
2021-10-17 17:07:28 +02:00
2021-10-17 17:07:28 +02:00
2021-10-17 17:07:28 +02:00
2021-10-17 17:07:28 +02:00
2021-10-17 17:07:28 +02:00
2021-10-17 17:07:28 +02:00
2021-10-17 17:07:28 +02:00
2022-05-11 20:57:02 +00:00

Runboat Pre-commit Status Build Status codecov Translation Status

social

TODO: add repo description.

Available addons

addon version maintainers summary
base_search_mail_content 15.0.1.0.1 Base Search Mail Content
mail_activity_board 15.0.1.0.0 Add Activity Boards
mail_activity_creator 15.0.1.0.0 Show activities creator
mail_activity_done 15.0.1.0.0 Mail Activity Done
mail_activity_partner 15.0.1.0.0 Add Partner to Activities
mail_activity_team 15.0.1.2.0 Add Teams to Activities
mail_attach_existing_attachment 15.0.1.0.0 Adding attachment on the object by sending this one
mail_debrand 15.0.1.2.0 pedrobaeza joao-p-marques Remove Odoo branding in sent emails Removes anchor <a href odoo.com togheder with it's parent ( for powerd by) form all the templates removes any 'odoo' that are in tempalte texts > 20characters
mail_optional_follower_notification 15.0.1.0.1 Choose to notify followers on mail.compose.message
mail_outbound_static 15.0.1.0.0 Allows you to configure the from header for a mail server.
mail_preview_base 15.0.1.0.0 Base to add more previewing options
mail_show_follower 15.0.1.2.1 Show CC document followers in mails.
mail_tracking 15.0.1.0.1 Email tracking system for all mails sent

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


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.

Description
OCA social fork
Readme 3.4 MiB
Languages
Python 48.5%
HTML 42.2%
JavaScript 8%
SCSS 1.3%