Templates API is currently in private beta and only available to a limited
number of users. APIs might change before GA.To use the methods on this page, you must upgrade your Resend Node SDK to
version
resend@https://pkg.pr.new/resend/resend-node/resend@cb04015
or
later.Get in touch if you're interested in testing
this feature.- Login/Auth
- Onboarding
- Ecommerce
- Notifications
- Newsletters
Add a template
There are two ways to add a template:- Add a template in the dashboard
- Import an HTML or React Email file
- Create a template by using the API
Add a template in the dashboard
The Templates dashboard shows all existing templates.

{{
in the editor.

Import an HTML or React Email file
You can also import an HTML or React Email file to create a template from your existing code. After importing, you can edit the template in the no-code editor and add variables as needed.
Create a template by using the API
Finally, programmatically create a template by using the API. The payload can optionally include variables to be used in the template.Duplicate a template
You can also duplicate an existing template in the dashboard or via the API.
Publish a template
By default, templates are in a draft state. To use a template to send emails, you must first publish it via the dashboard or via the API.
Adding variables
Resend supports both contact and custom variables. Each template may contain up to 20 variables.
{{{FIRST_NAME|fallback}}}
{{{LAST_NAME|fallback}}}
{{{EMAIL}}}
{{
in the editor. Define the name
, type
, and fallback_value
(optional).

key
: The key of the variable. We recommend capitalizing the key. (e.g.FIRST_NAME
).type
: The type of the variable. Possible values:'string'
,'number'
,'boolean'
,'object'
, and'list'
.fallback_value
: The fallback value of the variable. If no fallback value is provided, you must provide a value for the variable when sending an email using the template.object
andlist
types must include afallback_value
.
Delete a template
You can delete a template via the dashboard by clicking on the Delete button or via the API.
Using templates in transactional emails
When sending an email using a template, the template variables will be replaced with the actual values. Both the/emails
and /emails/batch
endpoints support templates.
cURL