provider Send Test Email POST /marketing/test/send_email
@utdk/sendgrid /marketing/test/send_email
Send a Test Marketing 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](https://mc.sendgrid.com/dynamic-templates) or the [Transactional Templates API](https://sendgrid.api-docs.io/v3.0/transactional-templates). > 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](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). You can also test your Single Sends in the [Twilio SendGrid Marketing Campaigns UI](https://mc.sendgrid.com/single-sends).

Try it

Authentication
Configure credentials for Email Activity (beta)
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

postMarketingTestSendEmail
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](https://mc.sendgrid.com/dynamic-templates) or the [Transactional Templates API](https://sendgrid.api-docs.io/v3.0/transactional-templates). > 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](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). You can also test your Single Sends in the [Twilio SendGrid Marketing Campaigns UI](https://mc.sendgrid.com/single-sends).

Input

A custom unsubscribe URL.

required

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

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

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

required

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.

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.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import sendgrid from '@utdk/sendgrid';

await sendgrid.postMarketingTestSendEmail()