Mensagem Transacional — Email¶
O payload de email enviado quando a mensagem transacional é enviada.
Endpoint¶
Todos os verbos: /transactional/<transactional>/message/<transactionalmessage>/email
GET¶
Payload: Sem payload.
Devolve: O email da mensagem.
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¶
| Parâmetro | Tipo | Descrição |
|---|---|---|
header_from_name |
string | Nome do remetente legível por humanos |
header_from |
string | Email do remetente (o domínio deve estar activo como domínio de envio) |
subject |
string | Assunto da mensagem |
message |
string | HTML da mensagem |
block_editor_content |
string (opcional) | JSON para conteúdo do editor de blocos (apenas Unlayer) |
attachment |
ficheiro (opcional) | Ficheiro de anexo |
Devolve: O novo email da mensagem.
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¶
Mesmo payload que o POST.
Devolve: O email da mensagem editado.
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: Sem payload.
Devolve: O email da mensagem eliminado.
Example: