Transactional Message — Email¶
The email payload sent when the transactional message is sent.
Endpoint¶
All verbs: /transactional/<transactional>/message/<transactionalmessage>/email
GET¶
Payload: No payload.
Returns: The message email.
Example:
curl -u "username:api_key" -H "Accept: application/json" \
https://app.duo.pt/transactional/{transactional_id}/message/{message_id}/email
Response:
{
"success": true,
"data": {
"transactionalMessage": {
"id": 1,
"name": "Order Confirmation",
"send_transactional": 1,
"event_callback": null
}
}
}
POST¶
| Parameter | Type | Description |
|---|---|---|
header_from_name |
string | Human-readable sender name |
header_from |
string | Sender email (domain must be enabled as sending domain) |
subject |
string | Message subject |
message |
string | Message HTML |
block_editor_content |
string (optional) | JSON for block editor content (Unlayer only) |
attachment |
file (optional) | Attachment file |
Returns: The new message email.
Example:
curl -u "username:api_key" -H "Accept: application/json" \
-F "header_from_name=My Brand" \
-F "header_from=noreply@yourdomain.com" \
-F "subject=Your+order+confirmation" \
-F "message=<html><body>Hi {{name}}, your order is confirmed.</body></html>" \
https://app.duo.pt/transactional/{transactional_id}/message/{message_id}/email
Response:
{
"success": true,
"data": {
"transactionalMessage": {
"id": 1,
"name": "Order Confirmation",
"send_transactional": 1,
"event_callback": null
},
"email": {
"envelope_from_domain": null,
"header_from_name": "TX",
"header_from": "sender@yourdomain.com",
"subject": "TX Subject",
"message": "<html><body>TX body</body></html>",
"attachment": null,
"memoizedAttachment": null,
"send_transactional": null,
"send_transactional_message": 95
}
}
}
PUT¶
Same payload as POST.
Returns: The edited message email.
Example:
curl -u "username:api_key" -H "Accept: application/json" -X PUT \
-F "header_from_name=My Brand" \
-F "header_from=noreply@yourdomain.com" \
-F "subject=Updated+subject" \
-F "message=<html><body>Updated body.</body></html>" \
https://app.duo.pt/transactional/{transactional_id}/message/{message_id}/email
Response:
{
"success": true,
"data": {
"transactionalMessage": {
"id": 1,
"name": "Order Confirmation",
"send_transactional": 1,
"event_callback": null
},
"email": {
"envelope_from_domain": null,
"header_from_name": "TX",
"header_from": "sender@yourdomain.com",
"subject": "TX Subject",
"message": "<html><body>TX body</body></html>",
"attachment": null,
"memoizedAttachment": null,
"send_transactional": null,
"send_transactional_message": 95,
"block_editor_type": null,
"block_editor_content": null
}
}
}
DELETE¶
Payload: No payload.
Returns: The deleted message email.
Example: