Skip to main content
This automation step triggers a Template email to be sent to the contact.

How it works

After adding a trigger, create a new step to Send an email.Add Send Email ActionSelect a published template, then configure the sender address.Send Email Action Sender SettingsOptionally, select a Topic to skip this step for contacts who opted out of it.The subject always comes from the Template. To send a different subject, set subject when creating the step via the API.
Only published templates are available to be used in an Automation.

Template variables

Use the variables field to pass data into your template. Each value is a static string, passed as-is, or a reference with { "var": "<path>" }:
  • event.* is a field from the event that triggered the Automation, such as event.firstName.
  • contact.* is a field from the contact, such as contact.properties.company.
  • wait_events.<event_name>.* is a field from an event a previous wait for event step received, such as wait_events.feedback.received.response. If the Automation waited for that event more than once, this is the most recent one before this step.
Template variables must be present in your referenced template and the key names must match exactly with the template variable names.

Use contact properties in a Template

A Template only reads the variables the step maps. It can’t read contact placeholders like {{{contact.first_name}}} or {{{contact.first_name|there}}}, which work in Broadcasts only. A Template that uses them fails when the step sends it, and the run’s status_reason is inline_fallback or template_render_failed. To greet the contact by name:
  1. In the Template, add a variable such as USER_FIRST_NAME, with there as its fallback value, and write Hi {{{USER_FIRST_NAME}}}. Resend uses the fallback when the contact has no first name set.
  2. In the step, map the variable to the contact property:
Built-in properties map as contact.first_name, contact.last_name, and contact.email. A custom property needs the properties. prefix: a Broadcast’s {{{contact.company}}} becomes { "var": "contact.properties.company" }. Use a variable name that isn’t reserved. FIRST_NAME is reserved, which is why the example uses USER_FIRST_NAME. For more help working with variables, see the Template documentation.

Send with a Topic

Set topic_id to send the email only to contacts subscribed to a Topic. This lets contacts opt out of one kind of Automation email, like product tips, while still receiving others.
When the step runs, Resend checks the contact’s subscription to the Topic:
  • Opted in: the email is sent.
  • Opted out: the step is skipped and no email is sent. The Automation continues to the next step.
  • No preference: the Topic’s default subscription decides. The email is sent if the default is opt_in, and the step is skipped if it’s opt_out.
The Topic must exist in your team. If it doesn’t, the API rejects the request with a 422 error.
If you delete a Topic that a send_email step uses, the step keeps the deleted Topic’s ID and fails every time it runs. Pick another Topic for the step or remove it before deleting the Topic.

Unsubscribe behavior

Resend does not automatically add an unsubscribe link to emails sent from a send_email step. To let contacts opt out, add {{{RESEND_UNSUBSCRIBE_URL}}} to the Template used by the step.
{{{RESEND_UNSUBSCRIBE_URL}}} must be added to the Template itself, not the step’s config. If the Template doesn’t include this variable, contacts have no way to unsubscribe from within the email.
When the Template includes {{{RESEND_UNSUBSCRIBE_URL}}}, Resend handles unsubscribes as follows, with or without a Topic:
  • Global unsubscribe always wins. A contact who is unsubscribed never receives Automation emails, even if they have opted in to the step’s Topic.
  • The unsubscribe link opens your preference page. It works the same as the Broadcast unsubscribe link.
  • One-click unsubscribe is global. Resend also adds List-Unsubscribe and List-Unsubscribe-Post headers, which inbox providers like Gmail show as an unsubscribe button. Using that button unsubscribes the contact from all Broadcasts and Automation emails, not only the step’s Topic.
See when to use an unsubscribe link to decide whether your Automation emails need one.

Configuration

object
required
The published template to send. Provide id and optionally variables.
string
The sender email address.If provided, this value will override the template’s default value.
string
The email subject line.If provided, this value will override the template’s default value.
string
Reply-to email address.If provided, this value will override the template’s default value.
string
The ID of the Topic this email belongs to. Contacts not subscribed to the Topic skip this step. See Send with a Topic.