Message templates
On the Templates tab you can write your own text for each event and see it filled in with a real order or form. Until you save a template, the standard message is sent.
Write a template
- Pick the chat and the event at the top of the tab. All chats is the template for every chat without its own.
- Edit the text. The editor starts with the standard message. Click a variable below it to insert it.
- Check the preview. Pick an order or a form on the right, or press Send to Telegram to see the real message.
- Press Save Changes.
To have a separate text in one chat, pick that chat and check Own template for this chat. Reset to standard brings the standard message back.
🛒 <b>#{order_number}</b>, {order_total}
{items}
<b>{customer_name}</b>
{phone}
<i>{customer_note}</i>
<a href="{order_url}">Open order</a>How the text is filled in
- Empty values do not leave gaps. A line whose variables are all empty is not sent, and neither is a paragraph. A line like
Phone: {phone}disappears when there is no phone. - Switches on the Events tab still work. With Phone turned off under Customer details,
{phone}stays empty in every template. - Long messages are split. Telegram allows 4096 characters in a message, so a longer text arrives as several. The preview tells you how many.
- An unknown variable is sent as written. The preview warns you about it.
Formatting
The Bold, Italic and Link buttons wrap the selected text. You can also type Telegram’s tags by hand: <b>, <i>, <u>, <s>, <code>, <pre>, <a href="…">, <blockquote> and <tg-spoiler>.
A tag that is not closed stops the template from saving, and the tab says which one. Anything else that looks like a tag is sent as plain text.
Order variables
| Variable | Value |
|---|---|
{order_number}, {order_date}, {order_status} | Number, date and status |
{order_total}, {order_subtotal} | Total, and subtotal before shipping and discounts |
{shipping_total}, {discount_total}, {refunded} | Shipping cost, discount and refunded amount |
{coupons}, {payment_method}, {shipping_method} | Coupons, payment and shipping method |
{items}, {items_count} | Products, one per line, and their number |
{customer_name}, {company}, {phone}, {email} | Customer details |
{address}, {customer_note} | Delivery address and the customer’s note |
{order_url}, {site_name} | Address of the order in the admin, and the site name |
{product_image}, {product_image_url} | Product image, see below, and its address |
{meta:key} | Any order meta field, for example {meta:delivery_date}. The tab lists the fields of the order in the preview |
The status change event also has {status_from}, {status_to} and {status_emoji}.
Product image
Telegram shows one picture in a text message, above or below all the text. The {product_image} tag says where: in the first line it goes above the text, anywhere else below it. It shows the image of the first product that has one.
Without the tag there is no picture, and the Product image switch on the Events tab does not apply to your own templates. Telegram loads the picture from your site, so the site must be public.
Form variables
| Variable | Value |
|---|---|
{fields} | All fields with labels |
{field:name} | One field. Pick a form in the preview, and the tab lists its fields |
{form_title}, {page_url}, {site_name} | Form title, address of the page with the form, site name |
{language}, {mail_warning} | Contact Form 7 only: language of the form (WPML, Polylang) and the warning when the site could not send the email |