django-anymail
django-anymail copied to clipboard
Issue parsing delivery delays from Postmark
Thank you for anymail! I am a huge, huge fan :)
I wanted to report a bug with how the backend parses delay notifications from Postmark. Here's a trivial stack trace:
KeyError: 'ErrorCode'
File "anymail/backends/postmark.py", line 65, in parse_recipient_status
error_code = one_response["ErrorCode"]
AnymailRequestsAPIError: Invalid Postmark API response format
KeyError: 'ErrorCode'
Postmark API response 200 (OK):
{
"Message": "Message accepted, but delivery may be delayed.",
"MessageID": "38360f97-ff7f-44b2-bcd1-5ea94ff2af00",
"SubmittedAt": "2024-08-05T02:03:37.0951168Z",
"To": "[email protected]"
}
With this being the relevant code. Seems straightforward enough, but I didn't know if Anymail has encountered/fixed this in any other ESPs. If so, happy to cargo-cult that approach and submit a fix.