curl -X POST https://api2.ecomailapp.cz/campaigns/1/send-test \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"emails": ["test@foo.cz", "qa@foo.cz"],
"merge": {
"first_name": "Foo"
}
}'
$campaignId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/campaigns/{$campaignId}/send-test");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'emails' => ['test@foo.cz', 'qa@foo.cz'],
'merge' => [
'first_name' => 'Foo',
],
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
{
"campaign_id": 1,
"sent_emails_count": 2
}
{
"errors": ["You can not do this because you have a blocked account"]
}
{
"errors": ["Only draft campaigns can be tested."]
}
{
"errors": {
"emails": ["The emails field is required."]
}
}
{
"errors": ["You have exceeded daily limit of sent test emails of 50."]
}
Campaigns
Send test campaign
Sends a test version of a draft campaign to up to 5 recipients.
POST
/
campaigns
/
{campaign_id}
/
send-test
curl -X POST https://api2.ecomailapp.cz/campaigns/1/send-test \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"emails": ["test@foo.cz", "qa@foo.cz"],
"merge": {
"first_name": "Foo"
}
}'
$campaignId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/campaigns/{$campaignId}/send-test");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'emails' => ['test@foo.cz', 'qa@foo.cz'],
'merge' => [
'first_name' => 'Foo',
],
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
{
"campaign_id": 1,
"sent_emails_count": 2
}
{
"errors": ["You can not do this because you have a blocked account"]
}
{
"errors": ["Only draft campaigns can be tested."]
}
{
"errors": {
"emails": ["The emails field is required."]
}
}
{
"errors": ["You have exceeded daily limit of sent test emails of 50."]
}
Only campaigns in draft status can be tested. The test send is rate limited per account.
integer
required
Campaign ID.
array
required
Recipients of the test email. At least 1 and at most 5 email addresses.
object
Optional map of merge-tag values used to personalize the test email. Keys are merge-tag names, values are their replacements; empty values are ignored.
curl -X POST https://api2.ecomailapp.cz/campaigns/1/send-test \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"emails": ["test@foo.cz", "qa@foo.cz"],
"merge": {
"first_name": "Foo"
}
}'
$campaignId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/campaigns/{$campaignId}/send-test");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'emails' => ['test@foo.cz', 'qa@foo.cz'],
'merge' => [
'first_name' => 'Foo',
],
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
{
"campaign_id": 1,
"sent_emails_count": 2
}
{
"errors": ["You can not do this because you have a blocked account"]
}
{
"errors": ["Only draft campaigns can be tested."]
}
{
"errors": {
"emails": ["The emails field is required."]
}
}
{
"errors": ["You have exceeded daily limit of sent test emails of 50."]
}
⌘I