Skip to main content

Template Emails

Use template sends when Mailtarget stores the message layout and your application supplies data.

curl https://transmission.mailtarget.co/v1/layang/transmissions \
-X POST \
-H "Authorization: Bearer $MAILTARGET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "Receipt for order #{{order_id}}",
"templateId": "tmpl_receipt_v3",
"from": { "email": "billing@your-verified-domain.com", "name": "Your Company" },
"to": [{ "email": "recipient@example.com" }],
"substitutionData": {
"order_id": "10042",
"amount": "250000"
},
"metadata": {
"order_id": "10042"
}
}'

Keep template variables stable. A missing variable can produce broken copy or a validation error, depending on template configuration.