Sending with a template
Sending emails through dynamic templates is one of the main uses of Waypoint. To send an email through a dynamic template, you can use the API call below. Within the call, you can pass data variables that are accessible from your template.
💡 New to using APIs? We recommend viewing our quick start guide with more in-depth descriptions and examples.
|templateId||The id of the template you want to send (created on the Waypoint dashboard). You can find the template ID from on each template from your templates page or grab it from the template URL. eg. |
|variables||Optional – JSON data object that is passed to the template and available as variables on the template.|
|to||Email address of the receiver(s). It can be an email address or use the “Display Name <email address>” format. Separate multiple email addresses in comma separated string for multiple emails (eg. "firstname.lastname@example.org, email@example.com").|
|from||Optional – email address of the sender. This will override a sender that has been set from the template builder and the email domain must be a verified domain within your workspace. Email address can be a string or with a name with email using the “Display Name <email address>” format.|
|cc||Optional – email address of the receiver(s) that should be CC'd. Use the same format as 'to' attribute.|
|bcc||Optional – email address of the receiver(s) that should be BCC'd. Use the same format as 'to' attribute.|
|metaId||Optional – can be used for internal reference or idempotent requests. Eg. 'order_1234'.|
💡 Use Node.js? Write even less code in your codebase by using the Waypoint npm package.
If you are looking to send test emails (not actually deliver the email), see API sandbox requests.