curl -X POST https://api2.ecomailapp.cz/transactional/send-template \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"template_id": 1,
"subject": "Email subject",
"from_name": "Sender'\''s name",
"from_email": "foo@bar.cz",
"reply_to": "foo@bar.cz",
"to": [
{
"email": "to@me.com",
"name": "Recipient'\''s name"
}
],
"global_merge_vars": [
{"name": "mergeTagName", "content": "mergeTagValue"}
],
"options": {
"click_tracking": true,
"open_tracking": true
}
}
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/transactional/send-template');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'message' => [
'template_id' => 1,
'subject' => 'Email subject',
'from_name' => "Sender's name",
'from_email' => 'foo@bar.cz',
'reply_to' => 'foo@bar.cz',
'to' => [
[
'email' => 'to@me.com',
'name' => "Recipient's name",
],
],
'global_merge_vars' => [
['name' => 'mergeTagName', 'content' => 'mergeTagValue'],
],
'options' => [
'click_tracking' => true,
'open_tracking' => true,
],
],
]));
$response = curl_exec($ch);
curl_close($ch);
{
"results": {
"total_rejected_recipients": 0,
"total_accepted_recipients": 2,
"id": 11668787484950529
}
}
Transactional emails
Send transactional template
Send a transactional email using a pre-defined template.
POST
/
transactional
/
send-template
curl -X POST https://api2.ecomailapp.cz/transactional/send-template \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"template_id": 1,
"subject": "Email subject",
"from_name": "Sender'\''s name",
"from_email": "foo@bar.cz",
"reply_to": "foo@bar.cz",
"to": [
{
"email": "to@me.com",
"name": "Recipient'\''s name"
}
],
"global_merge_vars": [
{"name": "mergeTagName", "content": "mergeTagValue"}
],
"options": {
"click_tracking": true,
"open_tracking": true
}
}
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/transactional/send-template');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'message' => [
'template_id' => 1,
'subject' => 'Email subject',
'from_name' => "Sender's name",
'from_email' => 'foo@bar.cz',
'reply_to' => 'foo@bar.cz',
'to' => [
[
'email' => 'to@me.com',
'name' => "Recipient's name",
],
],
'global_merge_vars' => [
['name' => 'mergeTagName', 'content' => 'mergeTagValue'],
],
'options' => [
'click_tracking' => true,
'open_tracking' => true,
],
],
]));
$response = curl_exec($ch);
curl_close($ch);
{
"results": {
"total_rejected_recipients": 0,
"total_accepted_recipients": 2,
"id": 11668787484950529
}
}
The message object containing all email details.
Show message properties
Show message properties
ID of the template to use.
Email subject line.
Sender’s display name.
Sender’s email address. Must be from a verified domain.
Reply-to email address.
curl -X POST https://api2.ecomailapp.cz/transactional/send-template \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"template_id": 1,
"subject": "Email subject",
"from_name": "Sender'\''s name",
"from_email": "foo@bar.cz",
"reply_to": "foo@bar.cz",
"to": [
{
"email": "to@me.com",
"name": "Recipient'\''s name"
}
],
"global_merge_vars": [
{"name": "mergeTagName", "content": "mergeTagValue"}
],
"options": {
"click_tracking": true,
"open_tracking": true
}
}
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/transactional/send-template');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'message' => [
'template_id' => 1,
'subject' => 'Email subject',
'from_name' => "Sender's name",
'from_email' => 'foo@bar.cz',
'reply_to' => 'foo@bar.cz',
'to' => [
[
'email' => 'to@me.com',
'name' => "Recipient's name",
],
],
'global_merge_vars' => [
['name' => 'mergeTagName', 'content' => 'mergeTagValue'],
],
'options' => [
'click_tracking' => true,
'open_tracking' => true,
],
],
]));
$response = curl_exec($ch);
curl_close($ch);
{
"results": {
"total_rejected_recipients": 0,
"total_accepted_recipients": 2,
"id": 11668787484950529
}
}
⌘I