Send a transactional email
Send a transactional email. While not strictly required, we recommend that you include a transactional_message_id in your request. If you don't, Customer.io attributes metrics to "transactional_message_id": 1, so multiple messages can roll up under the same ID.
If this is the first time you send a message with the API, you can include the auto_create parameter along with a transactional_message_id string to create a record for you.
You can also include a body, subject, and from values to override the message template. Or, if you create your message entirely through the API, you must include these values because your transactional_message_id won't have any content. See Examples and API parameters for more details.
Headers
The numeric ID of the workspace you want to send a message in. This header is only needed when you authenticate with a service-account bearer token (sa_live_…). Service accounts work across workspaces, so you must supply this header so we know which workspace to send from. You can omit this header when you authenticate with a standard App API key, which is always scoped to one workspace.
Request body
Example request
{
"transactional_message_id": 44,
"to": "cool.person@example.com",
"from": "override-templated-address@example.com",
"subject": "Order receipt",
"identifiers": {
"email": "cool.person@example.com"
},
"message_data": {
"password_reset_token": "abcde-12345-fghij-d888",
"account_id": "123dj"
},
"attachments": {
"file1.csv": "base64encodedcontent",
"file2.pdf": "base64encodedcontent"
},
"headers": {
"X-Mailgun-Tag": "my-cool-tag"
},
"bcc": "bcc@example.com",
"disable_message_retention": false,
"send_to_unsubscribed": true,
"tracked": true,
"queue_draft": false,
"disable_css_preprocessing": true
}Response
Returns a unique ID for the delivery.
Changes
No recorded changes to this endpoint across all 1 revision of this API.