Skip to main content

Custom events

An event is a named transactional email of your own, like an order confirmation or a booking reminder. You build the email once in the normal email builder, then wrap it in an event with a key like order_confirmation. From then on, your app or a trigger sends it by that key.

Manage events under Transactional, on the Custom events tab.

Step 1: build the template

Design the email in the regular email builder, exactly like any other template for that brand. Put placeholders wherever the dynamic parts go, for example {{order_number}} or {{first_name}}.

Two extras are available in transactional templates:

  • Repeating lists: wrap a repeating row in {{#each items}} ... {{/each}} and use each item's own fields inside, like {{name}} and {{price}}. Perfect for line items on a receipt.
  • Conditional parts: wrap something that only sometimes appears in {{#if discount}} ... {{/if}}. It renders only when that field is present in the data.

Two variables are always filled in for you and never need to be sent: brand_name and view_url (the "view in browser" link).

Step 2: create the event

  1. On the Custom events tab, pick your brand and click New event.
  2. Enter a Name, like "Order confirmation". The Event key fills in automatically (order_confirmation); you can change it. The key is what your app or trigger sends as type.
  3. Choose the Template you built. A preview appears below with a desktop and mobile toggle. If the list is empty, create a template in the email builder first.
  4. Write the Subject. It may use variables too, for example Your order {{order_number}} is confirmed.
  5. Optionally add a Preheader (preview text) and pick a Language.
  6. Click Create event.

As you configure it, the Data this event needs panel lists every variable the template and subject reference (excluding the automatic ones). These are the fields you must pass in data when you call the API or fire a trigger. Variables that only appear inside an #each loop or an #if block are not required. If the event references no variables at all, it sends a static email and only a recipient is needed.

warning

If a required variable is missing at send time, the send is rejected with the code missing_variables and the response tells you which ones. A half-filled email never goes out.

Manage events

Each event card shows its name, key, and the assigned template, plus:

  • Active toggle: turn an event off and any send using that key is rejected until you turn it back on.
  • Preview & test: see the fully rendered email and send yourself a real test (below).
  • Edit: change the name, key, template, subject, preheader, or language.
  • Delete: removes the event. Any app or trigger still sending that event key will start failing, and this cannot be undone. A confirmation dialog appears first.

If a card shows "template missing", the assigned template was deleted; edit the event and assign another one.

Preview and test an event

Preview & test on an event card renders the exact email a real send would produce, with sample values filled into every variable, in a desktop preview with an HTML source view.

From the preview, Send test to me sends that same email for real: through your transactional stream, to your own signed-in email address only. If it lands in your inbox, the event is fully wired end to end, sending domain included. Test sends appear in the send log with the source "Test".

The test uses the real send path, so it needs transactional sending enabled on your plan and the brand's sending domain verified, the same as a production send. That is the point: it proves the whole chain, not just the template.

What happens at send time

When a send arrives for an event key, SmartMailing renders the assigned template with the brand's colors, logo, and footer, fills the placeholders from the caller's data, and dispatches on the brand's transactional stream. Values you pass are safely escaped in the email body, so data from your systems cannot inject markup into the design.

Next: send the event with the API or with a trigger.