curl -X POST https://api2.ecomailapp.cz/transactional/send-message \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"subject": "Email subject",
"from_name": "Sender'\''s name",
"from_email": "foo@bar.cz",
"reply_to": "foo@bar.cz",
"text": "Plain text content",
"html": "<b>Email HTML content</b>",
"to": [
{
"email": "to@me.com",
"name": "Recipient'\''s name",
"cc": "cc@me.com",
"bcc": "bcc@me.com"
}
],
"global_merge_vars": [
{"name": "mergeTagName", "content": "mergeTagValue"}
],
"attachments": [
{
"type": "mime/type",
"name": "attachment-name.pdf",
"content": "base64encodedcontent"
}
],
"options": {
"click_tracking": true,
"open_tracking": true
}
}
}'
{
"results": {
"total_rejected_recipients": 0,
"total_accepted_recipients": 2,
"id": 11668787484950529
}
}
Send a transactional email with custom content.
curl -X POST https://api2.ecomailapp.cz/transactional/send-message \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"subject": "Email subject",
"from_name": "Sender'\''s name",
"from_email": "foo@bar.cz",
"reply_to": "foo@bar.cz",
"text": "Plain text content",
"html": "<b>Email HTML content</b>",
"to": [
{
"email": "to@me.com",
"name": "Recipient'\''s name",
"cc": "cc@me.com",
"bcc": "bcc@me.com"
}
],
"global_merge_vars": [
{"name": "mergeTagName", "content": "mergeTagValue"}
],
"attachments": [
{
"type": "mime/type",
"name": "attachment-name.pdf",
"content": "base64encodedcontent"
}
],
"options": {
"click_tracking": true,
"open_tracking": true
}
}
}'
{
"results": {
"total_rejected_recipients": 0,
"total_accepted_recipients": 2,
"id": 11668787484950529
}
}
address.name, email, email_id, address.email, env_from.{*|htmlcode|*} renders the HTML, while *|htmlcode|* shows raw HTML.to array with the same email but different cc/bcc values.Show message properties
text or html is required.text or html is required.curl -X POST https://api2.ecomailapp.cz/transactional/send-message \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"subject": "Email subject",
"from_name": "Sender'\''s name",
"from_email": "foo@bar.cz",
"reply_to": "foo@bar.cz",
"text": "Plain text content",
"html": "<b>Email HTML content</b>",
"to": [
{
"email": "to@me.com",
"name": "Recipient'\''s name",
"cc": "cc@me.com",
"bcc": "bcc@me.com"
}
],
"global_merge_vars": [
{"name": "mergeTagName", "content": "mergeTagValue"}
],
"attachments": [
{
"type": "mime/type",
"name": "attachment-name.pdf",
"content": "base64encodedcontent"
}
],
"options": {
"click_tracking": true,
"open_tracking": true
}
}
}'
{
"results": {
"total_rejected_recipients": 0,
"total_accepted_recipients": 2,
"id": 11668787484950529
}
}