Getting started with transactional emails

Create a transactional email template, add variables, test it, publish it, and send it through the API.

Transactional emails are sent to a single contact and triggered by a user action, like resetting a password or completing a purchase.

This guide walks you through creating a transactional template in Sendfully and sending your first email through the API.

How it works

Transactional emails in Sendfully follow a template-based workflow:

  1. Create a template in the editor with your email content and layout
  2. Define variables for dynamic content (like an order number or password reset URL)
  3. Test the template by sending a preview to your own inbox
  4. Publish the template to lock in a stable version for API use
  5. Send emails via the API by referencing the template and passing in variable values

Create a template

  1. Navigate to the Transactional page
  2. Click Create template
  3. Choose a starting point by selecting a pre-built design or clicking Blank canvas

Fill in the basics in the Details panel on the right side:

  • Sender name - An optional display name shown to recipients (e.g., Company Name). When set, the from address is formatted as Company Name <notifications@mail.yourdomain.com>.
  • From - The sender email address (e.g., notifications@mail.yourdomain.com)
  • Subject - The subject line your recipients will see. This supports variables, so you can include dynamic content like Your order {{order_id}} has shipped.

Then use the editor to compose your email body. You can add rich text, images, buttons, and other content blocks.

The template editor with the Details panel open

Template variables

Variables insert dynamic content into your emails using double curly brace syntax: {{variable_name}}.

There are two kinds of variables you can use:

Built-in contact variables

These are automatically available when the recipient matches a contact in your account:

VariableWhat it inserts
{{email}}The contact's email address
{{first_name}}The contact's first name
{{last_name}}The contact's last name

Custom template variables

For data specific to your template (like an order number or a reset link), define custom variables in the Variables section of the side panel.

When defining a variable, you'll set:

  • Label - A friendly name shown in the editor and test dialog
  • Key - The identifier used in your template (lowercase letters, numbers, and underscores only)
  • Type - The expected data type: string, number, boolean, or date

To insert a variable, place your cursor where you want it and type {{ to open the variable picker.

Inline fallbacks

You can add a fallback directly in the variable syntax: {{first_name|there}}. If the contact doesn't have a first name saved, the email will read "Hi there" instead of showing a blank.

Test your template

Before publishing, send a test email to check that your layout and variables look right.

  1. Click the Test email button in the editor header
  2. Enter a recipient email address
  3. Fill in values for your template variables
  4. Click Send test email

The test email arrives with a [Test] prefix in the subject line. It's a good idea to check it on both desktop and mobile, and in light mode and dark mode, to make sure everything looks right.

Test emails use the current draft, not the published version, so you can iterate without publishing.

Publish your template

Publishing makes your template available through the API.

  1. Click the Publish button in the editor header
  2. Review the template's details in the confirmation sheet
  3. Swipe to confirm

Each time you publish, Sendfully creates an immutable version snapshot. API sends always use the latest published version, so you can keep editing drafts without affecting live emails.

After publishing, you'll see a success page with your template key. This is the identifier you'll use when sending emails through the API. Copy it and keep it handy.

The publish success page showing the template key

Editing after publishing

You can keep editing a published template. The status changes to Edited to flag unpublished changes, and API sends continue using the last published version until you publish again.

Republishing creates a new version. You can view your version history and revert if needed.

Send an email via the API

Once published, send a transactional email by making a POST request to the send endpoint:

curl -X POST https://api.sendfully.com/v1/emails/send \  -H "Authorization: Bearer <token>" \  -H "Content-Type: application/json" \  -d '{    "templateId": "reset_your_password_98e1",    "to": "recipient@example.com",    "variables": {      "reset_url": "https://example.com/reset?token=abc123"    }  }'

You can also override the from address, subject line, and reply-to per send, and schedule emails for future delivery. The from field accepts a sender name using the format Sender Name <email@domain.com>.

For all available parameters, see the Send email API reference.

What's next?