Send a test email to yourself
Overview
Send a campaign's email to an address you choose so you can see it before customers do.
Use this while setting up a campaign or after editing a template.
You'll need the campaign_id and your email address.
The test email is sent. It isn't added to the campaign's recipient count, but it does use your plan's email allowance (402 when it is used up).
Prerequisites
- A bearer token. See Authentication.
- A campaign (
campaign_id) in your account whose Email channel is enabled and has a template. - An active plan on the campaign's location.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/campaign/test-email-review-request
Authentication
Account token
- The campaign must belong to your own account; otherwise
403(You are not authorized to test this campaign). - The campaign's location must have an active plan; otherwise
400.
Rate limit
60 requests per minute, counted per user (the token’s user). See Rate limits.
Request parameters
None.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
campaign_id | integer | Yes | The campaign to test. Must exist (otherwise 422) and belong to your own account (otherwise 403). |
customer_name | string | Yes | The name to use in the email, up to 255 characters. |
email | string | Yes | Where to send the test, up to 255 characters. Checked with an RFC and DNS lookup, so the domain must accept mail: addresses like @example.com are rejected with 422. |
is_test | boolean | No | true marks the send as a test in reporting. Default false. |
keywords | object | No | Values for your template's placeholders, as key/value pairs, e.g. {"paragraph_1": "Thanks for visiting!"}. Each key up to 100 characters; values are strings. Empty values are skipped. |
This route always sends an email, so the campaign's Email channel must exist, be enabled, and have a template. The call returns 400 immediately otherwise (Campaign does not have an active Email channel, or Email channel does not have a valid template. Please add a template to the Email channel.).
A campaign built with Create or edit a campaign has no template on its channels until you attach one, so every send fails until you do. Get each channel's id from
data.data.channels[].idin the step 2 or step 3 response, then attach a template to it:
- Email:
POST /api/v1/campaign/template/email/updatewithchannel_id,email_template_id(thevalueof an entry fromGET /api/v1/campaign/template/email/list, which returns{value, label}pairs),subject,html_content(orhtml_content_b64) andjson_content("{}"is fine). This sets the channel'stemplate_id, orfollow_up_template_idwhen the template'stemplate_typeisfollow_up.- SMS:
POST /api/v1/campaign/template/sms/updatewithchannel_id,sms_template_idandcontent.{ "channel_id": 812, "email_template_id": 34, "subject": "How did we do?", "html_content": "<p>Hi [customerName], tell us how we did.</p>", "json_content": "{}" }
Request payload
{
"campaign_id": 4823,
"customer_name": "Jane Smith",
"email": "<your-email>",
"is_test": true,
"keywords": {
"paragraph_1": "Thanks for visiting our store today!"
}
}Response body
The payload is inside data.
| Field | Type | Description |
|---|---|---|
status | string | success. |
message | string | Email review request sent successfully. |
Response payload
{
"data": {
"status": "success",
"message": "Email review request sent successfully"
}
}Examples
Success payload
See Response payload.
Error payload
400 No email channel
{
"message": "Bad Request",
"status": "error",
"errors": "Campaign does not have an active Email channel"
}400 No email template
{
"message": "Bad Request",
"status": "error",
"errors": "Email channel does not have a valid template. Please add a template to the Email channel."
}400 No active plan
{
"message": "Bad Request",
"status": "error",
"errors": "Store does not have an active plan"
}402 Plan allowance used up
{
"status": "error",
"message": "Limit reached for 'Email Solicitations': 500 of 500 units consumed this period.",
"feature": "review_solicitation_email",
"remaining": 0,
"hard_stop": true
}403 Campaign outside your account
{
"message": "Forbidden",
"status": "error",
"errors": "You are not authorized to test this campaign"
}422 Unknown campaign or email rejected
{
"message": "The selected campaign id is invalid. (and 1 more error)",
"errors": {
"campaign_id": [
"The selected campaign id is invalid."
],
"email": [
"The email field must be a valid email address."
]
}
}429 Too many requests
{
"message": "Too Many Attempts."
}| Status | Meaning |
|---|---|
200 | The test email is queued. |
400 | The campaign has no enabled Email channel or no template, or the location has no active plan. |
401 | The token is missing, expired or invalid. |
402 | The plan's email allowance for the period is used up, or the feature isn't on the plan. |
403 | The campaign belongs to another account. |
422 | A field is missing or invalid, or campaign_id doesn't exist. |
429 | More than 60 requests in a minute from this user. |
500 | Unexpected server error. |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/campaign/test-email-review-request" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"campaign_id": 4823, "customer_name": "Jane Smith", "email": "<your-email>", "is_test": true, "keywords": {"paragraph_1": "Thanks for visiting our store today!"}}'Updated 17 days ago
