Skip to main content
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
  }
}
message
object
required
The message object containing all email details.
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
  }
}