From b96742ecfa5b73966c1e779413e1b36aa25a584f Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Mon, 26 Aug 2019 09:52:03 -0300 Subject: [PATCH] [ADD] mail_tracking_mailgun: manage failed state from mailgun This change let odoo process a state sent from mailgun legacy webhooks that seems to apply when the message is not sent because the related email has been mark us as spam or have bounced before. For solve this add two new states to _mailgun_event_type_mapping_mailgun_event_type_mapping method: * failed: Mailgun could not deliver the email to the recipient email server * rejected: Mailgun rejected the request to send/forward the email source in https://documentation.mailgun.com/en/latest/quickstart-events.html#events. --- mail_tracking_mailgun/models/mail_tracking_email.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mail_tracking_mailgun/models/mail_tracking_email.py b/mail_tracking_mailgun/models/mail_tracking_email.py index 45cfa6cf4..77ec2db05 100644 --- a/mail_tracking_mailgun/models/mail_tracking_email.py +++ b/mail_tracking_mailgun/models/mail_tracking_email.py @@ -44,6 +44,8 @@ class MailTrackingEmail(models.Model): 'bounced': 'hard_bounce', 'dropped': 'reject', 'accepted': 'sent', + 'failed': 'error', + 'rejected': 'error', } def _mailgun_event_type_verify(self, event):