Skip to content

Mailjet webhook events fail when not grouped #106

@prettyv

Description

@prettyv

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)

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions