Send Personalized Email
Send transactional or marketing emails with per-recipient personalization (mail merge). Same request structure as POST /email, plus an optional merge_vars object on each recipients.to[] entry.
Personalization:
{{variable}}placeholders insubject,text,html,amp_htmlandfromNameare replaced with that recipient’smerge_varsvalues.- In
html,{{var}}is HTML-escaped; use{{{var}}}(triple brace) to inject raw HTML (pre-trusted content only). - Dot-notation walks nested objects:
{{order.id}},{{order.shipping.city}}. - A missing key renders as an empty string (never blocks the send).
- Rendering activates only when at least one recipient carries a non-empty
merge_vars; otherwise{{...}}is delivered literally (identical to/email).
CC / BCC: cc and bcc recipients receive an audit copy rendered against the first to recipient’s merge_vars scope.
Notes:
merge_varsmust be a JSON object — a non-object value returns400.- The combined size of all recipients’
merge_varsmust be ≤ 100 KB, else413. replyTomust be a verified sender address; it does not support{{var}}templates.- Mail merge is supported only on this HTTP endpoint (not on SMTP relay).
POST
Authorizations
Your Mailercloud API key (plain text, no Bearer prefix). Create keys in Settings → API.
Headers
Request body type
Body
application/json