Send a test email to specific email addresses.

Make a POST call to the /emails/activities/{campaign_activity_id}/tests endpoint to send a test email to specific email addresses. Test emails allow you to verify how the email campaign activity will look before you send it to contacts.

You can send up to 50 test emails per day. Each recipient you add to the email_addresses array counts towards this limit. This method returns a 429 “Too many requests” response code if you exceed the test email limit.

The test email does not process any dynamic content in the email campaign activity. Dynamic content includes contact and custom field variables.

URL Parameters

This method requires the campaign_activity_id URL parameter. Use this parameter to specify which primary_email role email campaign activity you want to test send.

Request Body

This method requires a request body that contains:

  • email_addressesRequired. The recipients of the test email as an array of strings. You can include up to 5 email addresses at a time. These email addresses can be any valid email address. They do not need to be verified Constant Contact account email addresses or contact emails.
  • personal_message — A personal message for the recipients of the test email as a string value. Constant Contact displays this message before the email campaign activity content.

For example:

{
  "email_addresses": [
    "ddipper@example.com","jacksbbq@example.com"
  ],
  "personal_message": "This is a test send of the email campaign activity."
}

Authorization Requirements

User privileges: campaign:send

Authorization scopes: campaign_data

Example Post Test Send Call

This example POST call sends a test email to the two recipients in the email_addresses array.

POST https://api.cc.email/v3/emails/activities/{campaign_activity_id}/tests

<?php

$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/emails/activities/{campaign_activity_id}/tests');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Postman-Token' => '8a7cf718-46c2-4c64-a6db-84df2dd201a6',
  'cache-control' => 'no-cache',
  'Authorization' => 'Bearer {access_token}',
  'Content-Type' => 'application/json'
));

$request->setBody('{
  "email_addresses": [
    "ddipper@example.com","jacksbbq@example.com"
  ],
  "personal_message": "This is a test send of the email campaign activity."
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"email_addresses\": [\n    \"ddipper@example.com\",\"jacksbbq@example.com\"\n  ],\n  \"personal_message\": \"This is a test send of the email campaign activity.\"\n}");
Request request = new Request.Builder()
  .url("https://api.cc.email/v3/emails/activities/{campaign_activity_id}/tests")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Basic {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
curl -X POST \
  https://api.cc.email/v3/emails/activities/{campaign_activity_id}/tests \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 9945de62-d1c8-4351-a757-d40440bae248' \
  -H 'cache-control: no-cache' \
  -d '{
  "email_addresses": [
    "ddipper@example.com","jacksbbq@example.com"
  ],
  "personal_message": "This is a test send of the email campaign activity."
}'

Response

A successful request returns a 204 No Content response code without a response body.

Try it!