Menu

Send Test E-Mail

Send a Test Marketing Email

Send a Test Marketing Email

POST /marketing/test/send_email

This endpoint allows you to send a test marketing email to a list of email addresses.

Before sending a marketing message, you can test it using this endpoint. You may specify up to 10 contacts in the emails request body field. You must also specify a template_id and include either a from_address or sender_id. You can manage your templates with the Twilio SendGrid App or the Transactional Templates API.

Please note that this endpoint works with Dynamic Transactional Templates only. Legacy Transactional Templates will not be delivered.

For more information about managing Dynamic Transactional Templates, see How to Send Email with Dynamic Transactional Templates.

You can also test your Single Sends in the Twilio SendGrid Marketing Campaigns UI.

Authentication

  • API Key

Headers

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required

Request Body

object
template_id
string

The ID of the template that you would like to use. If you use a template that contains a subject and content (either text or HTML), then those values specified at the personalizations or message level will not be used.

format: uuid
required
version_id_override
string

You can override the active template with an alternative template version by passing the version ID in this field. If this field is blank, the active template version will be used.

format: uuid
sender_id
integer

This ID must belong to a verified sender. Alternatively, you may supply a from_address email.

custom_unsubscribe_url
string

A custom unsubscribe URL.

suppression_group_id
integer
emails
array[string]

An array of email addresses you want to send the test message to.

maxItems: 10minItems: 1uniqueItems: True
required
from_address
string

You can either specify this address or specify a verified sender ID.

format: email
{
  "template_id": "f8f77db8-b9fa-4b3c-9ee8-de3d582016b8",
  "version_id_override": "7734f757-8eb8-4d22-b7f0-779a72f32986",
  "sender_id": 6060664,
  "custom_unsubscribe_url": "https://example.com/unsubscribe",
  "suppression_group_id": 21865513,
  "emails": [
    "janedoe@example.com",
    "tiramisu@example.com",
    "bundt@example.com"
  ]
}

Responses

object
object
errors
array[object]
message
string

the error message

field
string or null

the field that generated the error

help
object

helper text or docs for troubleshooting

id
string
{
  "errors": [
    {
      "field": "field_name",
      "message": "error message"
    }
  ]
}
Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the SendGrid tag on Stack Overflow.

Thank you for your feedback!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more