Skip to content

Create and preview an email template

Create an email draft and review its rendered subject, text, HTML, and safety result.

Email templates include a subject and HTML body. Previewing converts the draft into customer-visible output for review without publishing or sending it.

Prompt

Create an English email template named “Payment receipt” for receipts. Use the subject “Receipt for order {{order_number}}” and a short HTML body that greets {{customer_name}}, states {{amount}}, and links to {{receipt_url}}. Declare the appropriate required variable types. Show the draft before creating it, then preview it with representative values. Do not publish or send it.

The agent confirms create_message_template, then uses preview_message_template. The preview includes the rendered subject, text, HTML, header names, and available safety status without exposing stored header values.

Sample response

Email draft previewed

The rendered receipt is ready for review and remains unpublished.

Email preview
Template
Payment receipt
tmpl_example_receipt
Status
Draft
Subject
Receipt for order WEB-1042
Safety
Passed
Required variables used in the preview
VariableTypePreview value
customer_namestringAma Mensah
order_numberstringWEB-1042
amountstringGHS 125.00
receipt_urlurlhttps://example.com/receipts/WEB-1042

Text preview: “Hi Ama Mensah, we received GHS 125.00 for order WEB-1042. View your receipt.”

Template attachments can be stored for email templates, but send_customer_template does not currently send templates with attachments.

Type to search…

↑↓ navigate↵ selectEsc close