From f82372e2b5d310d135db97a1ff41888d99f90cc8 Mon Sep 17 00:00:00 2001 From: Conor Heine <1045603+cahna@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:09:13 -0800 Subject: [PATCH] Mailtrap webhook: fix incorrect reject_reason default Co-authored-by: Mike Edmunds --- anymail/webhooks/mailtrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anymail/webhooks/mailtrap.py b/anymail/webhooks/mailtrap.py index aedd668f..1adcd7b0 100644 --- a/anymail/webhooks/mailtrap.py +++ b/anymail/webhooks/mailtrap.py @@ -79,7 +79,7 @@ def parse_events(self, request): def esp_to_anymail_event(self, esp_event: MailtrapEvent): event_type = self.event_types.get(esp_event["event"], EventType.UNKNOWN) timestamp = datetime.fromtimestamp(esp_event["timestamp"], tz=timezone.utc) - reject_reason = self.reject_reasons.get(esp_event["event"], RejectReason.OTHER) + reject_reason = self.reject_reasons.get(esp_event["event"]) custom_variables = esp_event.get("custom_variables", {}) category = esp_event.get("category") tags = [category] if category else []