Email

Email Templates: Writing Them, Reading Them Back to Check, and Seeing What Actually Went Out

Templates are managed by slug, one Chinese and one English version each; how to read a template back to check it after writing it, and how to check the subject, sender, and body of what actually went out

On this page

An email template is the "draft" of a message: a subject + a body, one Chinese version and one English version, referenced by slug (for example, leadmagnet-toolkit).Automation rules' "Send email" action, and forms and popups' "Send email after submit" setting, all reference this slug.

Which language the recipient sees

Based on the language on the customer's record: Chinese customers get the Chinese version, English customers get the English version; if there's no English version, it falls back to Chinese.The body can include variables like {{name}} (how to address them) and {{data.field_name}} (something they filled into a form), which get substituted automatically when it's sent.

Which system emails follow your templates

The following emails are sent automatically by the system at the right moment. If your site has this template, and it's enabled, your template is used; if the template has been deleted or disabled, the system falls back to its own default version of that email (so the email is never simply not sent):

  • order-confirmed -- Store order confirmation (when a cart checkout succeeds; if this one doesn't exist, it falls back to shop_order_confirmed, then purchase-success, and only then the system default. See "Store order confirmation email" for details)
  • purchase-success -- Purchase successful - access granted (when a single product purchase is activated; also the fallback for store order confirmation. The password-setup link for new accounts is {{ activationUrl }} -- if a template doesn't include it, a new account still gets the system's activation email so they're not locked out. If you've also set up a "Payment succeeded -> send purchase-success" rule, the system won't send a duplicate)
  • renewal-thanks -- Renewal successful (sent on each successful subscription renewal charge; only sent if this template is enabled -- if it isn't, nothing is sent)
  • subscription-canceled -- Subscription cancelled (sent when a customer clicks "Cancel renewal," saying "Your membership runs through [date], and won't be charged again"; also sent when a subscription ends after repeated failed charges. Falls back to the system default if this template doesn't exist. Variables: {{ expiresAt }} the date it runs through, {{ cancelKind }} is either scheduled (cancelled renewal) or ended (ended outright))
  • booking-cancel -- Booking cancelled (sent to the customer when you or your AI cancel a booking, with a rebooking link {{ rebookUrl }} and the reason {{ cancelReason }}; falls back to the system default if this template doesn't exist)
  • refund-done -- Refund complete (on a full refund)
  • refund-partial -- Partial refund (on a partial refund; variables {{ paidMoney }} the original amount paid, {{ refundMoney }} the cumulative amount refunded; falls back to the system's default "partial refund" notice if this template doesn't exist)
  • order-shipped -- Shipping notice (when you click "Ship this order" in the admin panel, or your AI calls mark_order_shipped; variables {{ trackingNumber }} tracking number, {{ trackingCarrier }} carrier)
  • thanks-contact -- Message received (after a contact form submission; variables {{ subject }} {{ message }}. Issue-report receipts with a reference number still use the system email)
  • cart-recovery -- Abandoned cart recovery (sent when you click "Send recovery email" manually from the admin abandoned-cart list)
  • entitlement-expiring -- Expiry reminder (at 7 / 3 / 1 days remaining)
  • booking-confirm / booking-reminder -- Booking confirmation / reminder (variables {{ meetingUrl }} meeting link, {{ bookingTime }} booking time (in the customer's time zone), {{ bookingName }} booking type name; the confirmation email automatically includes a calendar invite .ics file)

For the complete list of variables, have the AI call list_merge_fields. The recipient's language is recorded from whichever page they were on at the time -- someone who registers / books / checks out on a Chinese-language page gets Chinese emails.

Let your AI handle it

  • list_email_templates: lists all templates
  • upsert_email_template: create or edit one. Only changes what you specify -- any language or field you don't pass stays as it was
  • get_email_template: reads back a template's full content (Chinese and English subject + body), useful for checking your work after editing
  • delete_email_template: deletes a template (it can't be recovered, so the AI asks you first and only deletes once you say yes). Before deleting it checks which automation rules, workflows and email sequences still use the template — if any do, it lists them and doesn't delete; it only deletes after you've changed them or you explicitly say "delete it anyway". If you just want to stop using it for now, have the AI turn it off instead (upsert_email_template with enabled:false) — you can turn it back on any time
  • list_email_logs / get_email_log: look up emails that have already been sent -- subject, body excerpt, sender (from), delivery status, opens/clicks

FAQ

  • I got the form's title in my receipt, not my template: fixed on 2026-09-21. Forms and popups now use your template if one's configured; if the template was deleted or disabled, nothing is sent, and the reason is logged in the email log.
  • The sender looks wrong: check the from field in list_email_logs. If it's not your domain, you haven't connected your own sending account yet (see "Setting up email sending").
  • Status shows "queued (to be resent)": your sending channel ran out of quota for today (for example, Resend's free tier allows 100 emails per day). Order confirmations, booking confirmations, and the like will never be lost -- they're queued and automatically resent once your quota resets (UTC midnight, or once you upgrade your plan), and each one is only sent once. list_email_logs shows the estimated resend time for each. If you're really running your business, it's worth upgrading to Resend Pro ($20/month, 50,000 emails/month, no daily cap) -- no need to change your key
  • Emails to invalid addresses are not retried, and fail immediately (with a reason in error); temporary server errors are automatically retried a few times after a delay

Unsubscribe link

  • Including {{ unsubscribeUrl }} in a template adds the unsubscribe link; {{ year }} is the current year
  • Marketing emails (broadcasts, or templates categorized as marketing / lifecycle / nurture -- e.g. cart recovery, win-back): automatically include the unsubscribe link and the email client's one-click unsubscribe, even if you didn't write it into the template -- it's appended at the bottom
  • Transactional emails (order confirmations, access granted, refunds, password reset / verification codes): never include the unsubscribe link, even if you wrote one into the template -- it's stripped out

What happens after a customer unsubscribes

  • A customer who clicks unsubscribe: stops receiving marketing emails going forward (broadcasts, cart recovery, win-back, nurture); transactional emails keep going -- order confirmations, course access, password-reset codes still arrive, otherwise they'd be locked out of a course they already bought
  • Hard bounces (address doesn't exist) / spam complaints: stop receiving everything -- sending to them again only hurts your sender reputation
  • Under admin "Deliverability," you can see which list an address landed on and why, and remove it manually
Last updated: October 5, 2026
Still stuck? Just ask

Write your question — we look in the docs first, and hand it to AI support if the answer is not there.

If you have connected an AI, you can ask it directly — it reads these same docs, and it can make the change for you.Or email us at support@dlxai.ai.
We use essential cookies; "Accept" also records device traits to prevent abuse. Cookie Policy