mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
**Mandrill, Postmark:** Normalize soft-bounce webhook
events to event_type 'bounced' (rather than 'deferred'). Fixes #56
This commit is contained in:
@@ -81,7 +81,7 @@ class MandrillTrackingWebhookView(MandrillBaseWebhookView):
|
|||||||
'send': EventType.SENT,
|
'send': EventType.SENT,
|
||||||
'deferral': EventType.DEFERRED,
|
'deferral': EventType.DEFERRED,
|
||||||
'hard_bounce': EventType.BOUNCED,
|
'hard_bounce': EventType.BOUNCED,
|
||||||
'soft_bounce': EventType.DEFERRED,
|
'soft_bounce': EventType.BOUNCED,
|
||||||
'open': EventType.OPENED,
|
'open': EventType.OPENED,
|
||||||
'click': EventType.CLICKED,
|
'click': EventType.CLICKED,
|
||||||
'spam': EventType.COMPLAINED,
|
'spam': EventType.COMPLAINED,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class PostmarkTrackingWebhookView(PostmarkBaseWebhookView):
|
|||||||
'SpamNotification': (EventType.COMPLAINED, RejectReason.SPAM),
|
'SpamNotification': (EventType.COMPLAINED, RejectReason.SPAM),
|
||||||
'OpenRelayTest': (EventType.DEFERRED, None), # Receiving MTA is testing Postmark
|
'OpenRelayTest': (EventType.DEFERRED, None), # Receiving MTA is testing Postmark
|
||||||
'Unknown': (EventType.UNKNOWN, None),
|
'Unknown': (EventType.UNKNOWN, None),
|
||||||
'SoftBounce': (EventType.DEFERRED, RejectReason.BOUNCED), # until HardBounce later
|
'SoftBounce': (EventType.BOUNCED, RejectReason.BOUNCED), # might also receive HardBounce later
|
||||||
'VirusNotification': (EventType.BOUNCED, RejectReason.OTHER),
|
'VirusNotification': (EventType.BOUNCED, RejectReason.OTHER),
|
||||||
'ChallengeVerification': (EventType.AUTORESPONDED, None),
|
'ChallengeVerification': (EventType.AUTORESPONDED, None),
|
||||||
'BadEmailAddress': (EventType.REJECTED, RejectReason.INVALID),
|
'BadEmailAddress': (EventType.REJECTED, RejectReason.INVALID),
|
||||||
@@ -48,8 +48,8 @@ class PostmarkTrackingWebhookView(PostmarkBaseWebhookView):
|
|||||||
'InboundError': (EventType.INBOUND_FAILED, None),
|
'InboundError': (EventType.INBOUND_FAILED, None),
|
||||||
'DMARCPolicy': (EventType.REJECTED, RejectReason.BLOCKED),
|
'DMARCPolicy': (EventType.REJECTED, RejectReason.BLOCKED),
|
||||||
'TemplateRenderingFailed': (EventType.FAILED, None),
|
'TemplateRenderingFailed': (EventType.FAILED, None),
|
||||||
# Postmark does not report DELIVERED
|
# DELIVERED doesn't have a Type field; detected separately below
|
||||||
# Postmark does not report CLICKED (because it doesn't implement click-tracking)
|
# CLICKED doesn't have a Postmark webhook (yet?)
|
||||||
# OPENED doesn't have a Type field; detected separately below
|
# OPENED doesn't have a Type field; detected separately below
|
||||||
# INBOUND doesn't have a Type field; should come in through different webhook
|
# INBOUND doesn't have a Type field; should come in through different webhook
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user