Send Email

mailjet.send_email
ActionEmailconnection required

Calls the Mailjet API with the connection's credentials.

Send a transactional email through Send API v3.1, either from inline text and HTML or from a stored template with its variables filled in.

Connection

Required
Yes — the node will not save without one
Auth type
Username & password
Providers
Mailjet
Secret shape
{"username": "<public API key>", "password": "<private API key>"} (+ "sms_token" for the SMS API)
Config it needs
sender_email, sender_name, sms_from, contacts_list_id, base_url
Resolved by
config.connection_id, else node.connection_id

Configuration

18 fields, none required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
to
Recipient addresses — one address, a comma-separated list, "Name <address>", or a JSON array of {"Email", "Name"} objects written as text.
stringNo——jane@example.com
subject
Subject line of the message. A template supplies its own when this is left blank.
stringNo———
text_part
Plain-text body of the message. One of text_part, html_part or template_id must be set.
stringNo———
html_part
HTML body of the message. One of text_part, html_part or template_id must be set.
stringNo———
template_id
Numeric id of the Mailjet template to send. The template supplies the body, and 'variables' fills in its placeholders — Mailjet's guide says not to set text_part or html_part as well.
numberNo—≥ 1—
template_language
Whether Mailjet should process the template language. On by default whenever a template_id is set; turn it on by hand to use {{var:…}} placeholders inside text_part or html_part, and off to send the markup literally.
booleanNo———
variables
Values for the {{var:…}} placeholders, e.g. {"name": "Jane"}. Mailjet only substitutes them while the template language is on, so set template_language when the placeholders are in text_part or html_part rather than in a stored template.
objectNo——{"name":"Jane"}
from_email
Sender address for this message; overrides the sender on the connection. Must be a validated Mailjet sender.
stringNo———
from_name
Sender display name for this message; overrides the connection.
stringNo———
cc
Carbon-copy addresses, in the same forms 'to' accepts.
stringNo———
bcc
Blind-carbon-copy addresses, in the same forms 'to' accepts.
stringNo———
reply_to
Address replies should go to, when it differs from the sender.
stringNo———
custom_id
Your own id for this message; Mailjet echoes it back on the send result and on every event webhook for the message.
stringNo———
custom_campaign
Groups this message into a named campaign in Mailjet's statistics.
stringNo———
headers
Extra SMTP headers as a JSON object, e.g. {"X-Trace": "abc"}.
objectNo——{"X-Trace":"abc"}
attachments
Attachments as a JSON array of Mailjet attachment objects, each with "ContentType", "Filename" and base64 "Base64Content".
arrayNo—array of object—
sandbox_mode
Validate the message and report the result without delivering it.
booleanNofalse——
messages
Advanced: a ready-made Send API 'Messages' array, posted verbatim. Set this to send a batch; every other field is then ignored.
arrayNo—array of object—
  • At least one of to, messages must be set.
  • At least one of text_part, html_part, template_id, messages must be set.

Example configuration

Every value below is the contract’s own example or default — nothing invented.

{
  "headers": {
    "X-Trace": "abc"
  },
  "sandbox_mode": false,
  "to": "jane@example.com",
  "variables": {
    "name": "Jane"
  }
}

Output

One shape.

result

FieldTypeExample
messages
Mailjet's per-message results, each with its own Status and, where it failed, its Errors.
array—
sent
How many messages Mailjet accepted.
number—
failed
How many messages Mailjet rejected.
number—
all_sent
True only when at least one message was sent and none failed.
boolean—
message_ids
Numeric message ids of the accepted messages.
array—
message_uuids
Message UUIDs of the accepted messages.
array—
message_hrefs
API URLs for the accepted messages.
array—
errors
The error objects Mailjet returned for the rejected messages.
array—
{
  "all_sent": false,
  "errors": [],
  "failed": 0,
  "message_hrefs": [],
  "message_ids": [],
  "message_uuids": [],
  "messages": [],
  "sent": 0
}

Notes

  • Send API v3.1 answers HTTP 200 as long as one message was accepted, so check 'all_sent' or 'failed' rather than assuming the step succeeding means every recipient was mailed.

See Send Email 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.