Creating Templates
You can draft and publish reusable email Templates with Resend’s no-code editor or programmatically. Templates allow you to send your frequently used transactional emails without needing to include the entire HTML body content. You can also include Template variables that will be replaced with personalized information when sending, such as a customer’s first name. You can create a new transactional email Template in several ways: A new Template must be published before it can be used to send emails.Add a Template in the Dashboard
To create and publish a new Template using the no-code editor:1
Go to the Templates page in your Resend dashboard.
2
Click Create template.
3
Add sender info.
Choose any username at your verified domain to send your email from.We suggest you choose a
from name and address that assures the reader the email is coming from you, for example:My Company Name <company@email.example.com>
4
Create a subject for your email.
5
Optionally define other email fields.
Resend’s no-code Template editor allows you to specify optional fields such as a different Reply-to address or preview text for email clients.
6
Write your email content.
You can use
/ commands in the Template editor for UI elements such as headings, lists, and images. You can also compose your body text in Markdown and add Template variables to personalize content.Alternatively, you can paste or drag in content from an existing HTML or React Email file.7
Use the sidebar to add custom styles.
When you select an element such as text, images, or the entire page, you will see contextual styling menu options in the page sidebar. Choose colors, sizes, layouts, and more in the sidebar or add your own global CSS styles directly in the editor.
8
Send yourself a test email.
Click
Test email and add one or more email addresses to send a test email. You will see any Template variables and can update their default values before sending.9
Publish your Template.
Click
Publish to prompt Resend’s review feature. This will check for any errors or concerns with your Template and allow you to catch common mistakes before publishing.10
Slide to confirm.
When there are no errors, the “Slide to publish” element will be active. Slide the arrow to confirm that you are ready to publish your Template. Only published Templates can be used to send emails.Alternatively, exit the editor to leave your Template saved as a draft. It is automatically saved as you compose.
Add a Template with the API
Programmatically create a Template from your application with the Templates API. The payload can optionally include variables to be used in the template.Add a Template from an existing file
You can create a Template from existing resources such as an HTML or React Email file. Create a new Template in the Dashboard, then paste or drag in your HTML or React Email content.When pasting React Email code, only imports from
@react-email/components and
react are supported. Local file imports (e.g., ./components/Logo) and
other third-party packages are not supported in the editor.Duplicate a Template
You can duplicate an existing Template in the Dashboard, via the Templates API, or with a Templates CLI command.
Clone a Broadcast
You can turn any sent Broadcast into a reusable Template. Cloning reuses a Broadcast’s design and content as a starting point for transactional emails. Locate your desired Broadcast in the Broadcast dashboard, click the more options button , and choose Clone as Template.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, using the Templates API, or with a Templates CLI command.
Node.js
Edit a Template
You can only send emails using the most recently published version of a Template. Once a Template is published, you can continue to edit it as a draft without impacting any emails sent using the Template. To use an updated version of your Template, you must publish your Template again to create a new version for sending. Until you republish, any edits are only saved in draft form. After you publish a new version, your changes will then be reflected in any future emails using the Template. Learn more about editing Templates in production safely with version history.Delete a Template
You can delete a Template via the Dashboard by clicking on the Delete button, via the Templates API, or with a Templates CLI command.
API Reference
For complete API documentation, see the Templates API reference and thetemplate parameter of the Sending API.