Test Sending an Email Campaign

Use this endpoint to test what an email campaign message will look like by sending it to a maximum of 5 recipients.

NOTE: Any dynamic content included in the campaign will not be processed because test send does not merge data from a contact list when sending the test message.

Methods:

Click a method to view its documentation

POST

DescriptionTOP

Privileges required: campaign:send

Send the email campaign message specified by the campaignId path parameter to the email addresses (maximum of 5) in the email_address array in the JSON request payload. You can preview email campaign messages with a status of DRAFT, SENT, and SCHEDULED.

Things to know about previews

  • Any content that is customized for each recipient in an email campaign will not be processed when the campaign is previewed. This is because the preview function does not use the syndication process used to deliver production campaigns. Previews are sent to email addresses, as opposed to a list of contacts. 

  • Email campaigns can, including previews messages, to up to 50 non-verified email addresses, 5 at a time, in a 24 hour period. There is no limit on sending messages to verified email addresses.

  • You need to set the format property to define the content types that will be sent in the preview:
    • HTML - sends only the HTML version of the message (defined in email_content)
    • TEXT - sends only the text version of the message (defined in text_content)
    • HTML_AND_TEXT - sends two test messages, the HTML and the text versions of the message.

NOTE: You cannot preview XHTML formatted email campaign messages (email_content_format = XHTML).

POST: https://api.constantcontact.com/v2/emailmarketing/campaigns/{campaignId}/tests

Test API

name

type

default

description

api_key

query

REQUIRED; The API key for the application

campaignId

path

Specifies the email campaign message to retrieve (GET)

Example JSON Request BodyTOP

{
  "personal_message": "This is a test send of the email campaign message.",
  "email_addresses": ["address1@example.com", "address2@example.com","address3@example.com"],
  "format": "HTML_AND_TEXT"
}

Response CodesTOP

code

description

200

Request was successful

400

Bad Request:Either JSON was malformed or there was a data validation error

401

Authentication failure

404

No campaign found for provided campaignId

406

Unsupported accept header value, must be application/json

415

Unsupported content-type in the header, use application/json

500

Internal server error occurred

StructureTOP

property

type(max length)

description

email_addresses

array

Enter up to 5 email addresses to send the preview message to

format

string

REQUIRED. Defines the content that will be sent in the preview, valid values are:

  • HTML - sends only the HTML version of the campaign message, defined in the email_content property of the email campaign message
  • TEXT - sends only the text version of the campaign, defined in the text_content property of the campaign message
  • HTML_AND_TEXT - sends both the email_content and the text_content versions of the campaign message

personal_message

string (5000)

REQUIRED. Message to include with the preview of the email campaign, could be similar to: I am testing out my next email marketing message.

Example ResponseTOP

{
    "format": "HTML_AND_TEXT",
    "personal_message": "This is a test send of the email campaign message.",
    "email_addresses": [
        "address1@example.com",
        "address2@example.com",
        "address3@example.com"
    ]
}