You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently (django-anymail v2.2) produces a TypeError when an event type is not configured to be grouped in Mailjet's event trigger settings. This is because the Mailjet webhook handling assumes the body to always be a JSON list containing all events although this is not the case when an event type is not marked to "Group events", which will send each event individually as a JSON dict.
This leads to TypeError: string indices must be integers in webhooks/mailjet.py:57 since esp_event is now a string (key of the event dict).
I guess the reason it is currently implemented like this is that it seems like the official documentation doesn't actually consider this and just says All the events will be delivered to your webhook in a JSON array of event objects. (https://dev.mailjet.com/guides/#endpoint-url)
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. Mailjet event grouping is recommended, but Anymail should support it either way, so this is a bug.
(And you're right: I interpreted the docs the same way you did, and never tested without "Group events" enabled. I should really know better than to trust ESP documentation by now. :-))
Currently (django-anymail v2.2) produces a TypeError when an event type is not configured to be grouped in Mailjet's event trigger settings. This is because the Mailjet webhook handling assumes the body to always be a JSON list containing all events although this is not the case when an event type is not marked to "Group events", which will send each event individually as a JSON dict.
This leads to
TypeError: string indices must be integers
in webhooks/mailjet.py:57 sinceesp_event
is now a string (key of the event dict).I guess the reason it is currently implemented like this is that it seems like the official documentation doesn't actually consider this and just says
All the events will be delivered to your webhook in a JSON array of event objects.
(https://dev.mailjet.com/guides/#endpoint-url)The text was updated successfully, but these errors were encountered: