Event
trigger.mailjet_event
TriggerEmailconnection requiredruns in-engine
Registers a Mailjet event callback URL per event type at publish and starts one run per delivered event. Emits {event, email, message_id, payload}.
Start a run on a Mailjet message event (bounce, open, click, unsub…).
Connection
- Required
- Yes — the node will not save without one
- Auth type
- Username & password
- Providers
- Mailjet
- Secret shape
- {"username" (public key), "password" (private key)}
- Resolved by
- config.connection_id, else node.connection_id
- Note
- The Basic pair is what registers the callbacks; the SMS token plays no part here. Publishing needs MANTLE_APP_PUBLIC_BASE_URL set — Mailjet refuses a bare root URL as a callback, which the /hooks path satisfies.
Configuration
1 field, none required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
events Which Mailjet events to subscribe to. One callback URL is registered per event type and deleted again when the workflow is unpublished or disabled. | array | No | ["bounce"] | 1–7 characters; array of string | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"events": [
"bounce"
]
}Output
One shape.
mailjet event
A flat envelope over one Mailjet event object. The per-event extras stay under `payload`, because their keys depend on `event`.
Extra keys beyond the ones listed can appear.
| Field | Type | Example |
|---|---|---|
event The Mailjet event type. Branch on this when the trigger subscribes to more than one. | string | bounce |
email The recipient the event is about. | string | buyer@example.com |
message_id Mailjet's numeric message id, as a string so a 64-bit id survives. Pass it to mailjet.get_message for the full delivery record. | string | 19421777835146490 |
message_guid Mailjet's GUID for the same message. Part of the idempotency key, because Mailjet sends no event id of its own. | string | 1ab23cd4-e567-8901-2345-6789f0gh1i2j |
time When Mailjet recorded the event, epoch seconds. | number | 1717070400 |
occurred_at The same instant as an ISO-8601 UTC string, for nodes that want a date. | string | 2024-05-30T12:00:00Z |
custom_id The CustomID the sender attached to the message. The only reliable way to tell a workflow's own mail apart from everything else the API key sends — these callbacks are account-wide. | string | invoice-4821 |
campaign_id Mailjet's campaign id for the message, as a string. | string | 7257 |
contact_id Mailjet's contact id for the recipient, as a string. | string | 4 |
custom_campaign The custom campaign name the sender set, when there was one. | string | — |
payload Mailjet's event object exactly as it arrived. The per-event extras live here: url on a click, error and hard_bounce on a bounce, ip/geo/agent on an open, smtp_reply on a sent, source on a spam complaint, mj_list_id on an unsub. | object | — |
{
"campaign_id": "7257",
"contact_id": "4",
"custom_campaign": "",
"custom_id": "invoice-4821",
"email": "buyer@example.com",
"event": "bounce",
"message_guid": "1ab23cd4-e567-8901-2345-6789f0gh1i2j",
"message_id": "19421777835146490",
"occurred_at": "2024-05-30T12:00:00Z",
"payload": {
"CustomID": "invoice-4821",
"MessageID": 19421777835146490,
"Message_GUID": "1ab23cd4-e567-8901-2345-6789f0gh1i2j",
"Payload": "",
"blocked": false,
"customcampaign": "",
"email": "buyer@example.com",
"error": "user unknown",
"error_related_to": "recipient",
"event": "bounce",
"hard_bounce": true,
"mj_campaign_id": 7257,
"mj_contact_id": 4,
"time": 1717070400
},
"time": 1717070400
}Notes
- The subscription is per API KEY, not per message: every mail that key sends produces these events, including mail sent outside Mantle. Filter on custom_id when the workflow should only react to its own.
- Mailjet does NOT sign its deliveries — there is no signature to check, and the callback URL's unguessable id is what keeps the endpoint private.
- Mailjet retries a failed delivery every 30 seconds for up to 24 hours, so an endpoint that is down does not lose events; runs are de-duplicated on the message GUID, event and event time.
- A grouped callback (Version 2, set in the Mailjet account) posts a JSON array; each entry starts its own run.
- Publishing creates the callbacks at Mailjet; unpublishing, disabling or archiving deletes them.
See Event run in a workflow.
In a technical demo we add the Mailjet connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.