Skip to main content

Triggers and the send log

A trigger is a webhook URL that sends one of your custom events without any code on your side. You paste the URL into an outside tool (Stripe, Shopify, Zapier, or your own system). When that tool POSTs a payload to the URL, SmartMailing reads the recipient and the variables out of it using a mapping you set up once, with clicks.

Manage triggers under Transactional, on the Triggers tab. You need at least one custom event first.

Create a trigger

  1. Pick your brand and click New trigger.
  2. Enter a Name, like "Stripe order paid", and choose which event it sends under Sends this event.
  3. Paste a Sample payload: an example of the JSON the outside tool will send. This is optional but strongly recommended, because every mapping is previewed against it live.
  4. Map the Recipient email: type the path to the recipient's address inside the payload, like customer.email. A path like customer.email means the email field inside customer.
  5. Under Map this event's variables, give each of the event's variables a path, for example order.id for order_number. As you type, the real value pulled from your sample shows on the right, or "not found" if the path is wrong. Every variable must be mapped before you can save.
  6. Optionally adjust the Shared secret. It is pre-filled and recommended; see below.
  7. Click Create trigger, then Copy the inbound URL from the trigger's card and paste it into your tool.

The URL looks like:

https://smartmailing.io/api/triggers/{your-token}

Preview before you rely on it

With an event chosen and a sample payload pasted, click Preview email. SmartMailing runs your mapping against the sample and renders the exact email a real send would produce. The preview shows the rendered subject and HTML, and warns you if the sample is missing any required variables. Nothing is sent.

The shared secret

The unguessable token in the URL is the primary protection. If the trigger has a shared secret, callers must also send it in an x-trigger-secret header, and requests without it are rejected. Keep the secret unless your tool cannot send a custom header. Triggers without one are marked not secured on their card.

Avoiding duplicate sends

Many tools retry webhook deliveries. A caller can pass its own event id in an Idempotency-Key header; if the same key is replayed within 24 hours of a successful send, SmartMailing acknowledges it without sending the email again.

Manage triggers

Each trigger card shows which event it fires, how many times it has fired, and whether it is secured, plus:

  • Active toggle: switch a trigger off and its URL stops accepting requests until you switch it back on.
  • Edit: change the mapping, event, or secret.
  • Delete: the webhook URL stops working immediately and this cannot be undone.

The send log

At the bottom of the Triggers tab, Recent sends lists the latest transactional sends for the brand, from triggers and from the API alike. Each row shows:

  • The result: Sent, Failed, or Skipped.
  • The event key and the recipient.
  • For failures, the reason, for example Missing variables, Render failed, Recipient suppressed, Rate limited, or Daily cap reached.
  • The source (API or Trigger) and when it happened.
  • For delivered emails, a link that opens the exact email that was sent, as the recipient saw it. This view stays available for 30 days.
tip

The send log is the first place to look when an email "didn't arrive". A Skipped row with Recipient suppressed means the address previously bounced or complained; a Failed row names the exact reason.