Template editor
The template editor decides how the message is written for each offer: which data comes out, in what order, with what formatting and when. The message is built from blocks that you can reorder, switch on, switch off and set conditions on, one by one.
On this page
The essentials
- Press a block in the list to open it, or Add block to create one.
- Write its Content: the text, the formatting with the toolbar buttons and the variables, such as
{{title}}or{{price}}, which can also be inserted from Variable…. - If the block should only come out sometimes, give it Display conditions.
- Press Confirm and look at the result in the Preview.
- Press Save.
Each channel has its own template
The message template belongs to each channel: the editor works on the active channel, the one the side menu selector marks. Change channel there to edit another one's template. When you create a channel you can copy the template of one you already have with Copy settings from.
The screen
- Blocks: the message's blocks in their order, with how many there are (“11 in the template”) and the Add block button. Above the list the validation notices appear, if there are any.
- The space between two blocks: press it to change it.
- Preset templates, import and export.
- Preview: the message as it will look in Telegram, with sample data. With no active block it says “No content”.
- Discard and Save, switched off until something differs from what is saved.
The first time you open the Template editor, a guided tour points out its parts. You can skip it, and start it again whenever you like from the button in the header, with Repeat the tour.
Any change shows up in the preview without saving anything, using a sample offer: an Amazon iPhone 15 Pro Max at 1,099.99 with a list price of 1,399.99, a header, a footer, a description and two coupons. The preview never carries a photo: the image of the offers is decided by the image template.
On a narrow screen the preview peeks out from the bottom edge: the arrow in its header (See the preview) scrolls down to it and the arrow (Back to the form) takes you back up.
The blocks
The final message is the sum of the active blocks whose conditions are met, in the order of the list.
Press a row, outside its controls, to open the block; with the keyboard, reach the row with Tab and press Enter or the space bar.
| Action | What it does | |
|---|---|---|
| Drag | Moves the block to another position. On a touch screen, press and hold for a moment before dragging. | |
| Move up and Move down | The same, one step at a time. They only appear on a phone, where the handle does not and the arrows are the only way to reorder. | |
| See the condition | The funnel says the block only comes out sometimes; when you press it you read the condition in the editor’s words, for example “Only if Store equal to Amazon and Discount greater than 30”. | |
| More actions | A menu with Block enabled, Space before, Space after —three switches that change without opening the block—, Duplicate and Delete. |
- Add block creates an empty one at the end, with the space after switched on, and opens its window, New block, for you to write the content. If you close it without writing anything, the block does not stay in the list.
- Duplicate puts the copy right below the original, with the name followed by “(copia)”.
- Delete removes the block without asking. If you regret it, Discard before saving brings it back.
- A disabled block looks dimmed, does not come out in the message and is not validated either: an error inside a switched-off block does not stop you from saving. At least one block has to stay active.
- There is no limit on the number of blocks.
The space between blocks
The gap between two rows says what the message puts between those two blocks. Press it to change it: it cycles through three states, no break (the two texts run on, on the same line), line break (each on its own line) and blank line (an empty line between them). The more it separates, the taller the gap.
Blocks that do not come out do not separate
If a block is switched off or its condition is not met, it disappears from the message and the space that remains is the one between the blocks that do come out. A block with empty text writes nothing either, but its breaks do count: the factory template uses one like that, called “Spacer”, to leave a fixed blank line.
The Before and After switches
Each block has two switches, Before and After, and each one adds one line break. Pressing the gap changes the “After” of the block above and the “Before” of the block below. Between two blocks there is never more than one blank line, and nothing is written before the first block or after the last.
Editing a block
Pressing a row opens the Edit block window. In its header is the On switch; below it, three parts:
- Name (optional) and the Line breaks (Before and After). The name is only for you: it identifies the row and heads its validation notices. It never reaches Telegram.
- Content: the block's text.
- Display conditions.
It closes with Confirm, which applies the changes to the list (still unsaved), or with Cancel, the × or Escape. If you had touched anything, it asks first. Pressing outside the window does not close it.
Content and formatting
The text box accepts several lines and the formatting tags that Telegram understands. The toolbar buttons —bold, italic, underline, strikethrough, monospace, code, link, spoiler and quote— apply the format to the selected text; with nothing selected, they insert the tags at the cursor and leave it between them (Link writes <a href="">text</a> and leaves the cursor between the quotes, for the address).
The tag behind each button, and for those who want to go beyond the toolbar
| Button | Tag | |
|---|---|---|
| Bold | <b>…</b> |
|
| Italic | <i>…</i> |
|
| Underline | <u>…</u> |
|
| Strikethrough | <s>…</s> |
|
| Monospace | <code>…</code> |
|
| Code | <pre>…</pre> |
|
| Link | <a href="">…</a> |
|
| Spoiler | <tg-spoiler>…</tg-spoiler> |
|
| Quote | <blockquote>…</blockquote> |
- There are no keyboard shortcuts: formatting is applied with the buttons or by typing the tags.
- Telegram's synonyms typed by hand also work:
<strong>,<em>,<ins>,<strike>and<del>. - A collapsible quote is written by hand:
<blockquote expandable>…</blockquote>. It is the only attribute the quote accepts; in a link onlyhrefis valid and in<code>onlyclass. Any other attribute is an error. - Links can only start with
http://,https://,mailto:ortg://. And they can carry a variable inside:<a href="{{url}}">Go to the offer</a>is what the factory “Link” block does. - A tag that Telegram does not accept (
<img>,<div>…) shows up as written in the preview and does not let you save.
Variables
Variables are written between double braces, {{title}}, or inserted from the Variable… dropdown, which lists them by their name in the application's language. When the message is built they are replaced with the offer's data:
| Variable | In the dropdown | What it writes |
|---|---|---|
{{title}} |
Title | The offer's title. |
{{price}} |
Price | The current price, with currency and separators according to your organization's region: “1.099,99 €”. |
{{pvp}} |
List price | The price before the discount, formatted the same way. Empty if the offer has none. |
{{discount}} |
Discount | The percentage saved, just the number (“21”): you write the % after it yourself. It is 0 when there is no list price. |
{{url}} |
URL | The offer's link, already with your affiliate tag if it has one. |
{{header}} |
Header | The header typed in Create offer, or the channel's default. |
{{footer}} |
Footer | The form's footer, or the channel's default. |
{{description}} |
Description | The description typed in the form. |
{{coupons}} |
Coupons | The coupons, each one in monospace so it can be copied with one tap. |
{{image_url}} |
Image | The address of the photo, if the offer has one. |
{{store}} |
Store | The store's name according to the application's store catalogue. Empty if the store is not in it, also if it is a store of your own from your affiliate rules. |
The variable brings the symbol
{{price}} and {{pvp}} write the whole amount —currency, separators and decimals— the way your organization's region writes it. Do not add the symbol after it: it would come out twice. In a condition they are still numbers: price > 20 compares the amount, not the text.
Fine print: an empty or misspelled variable
- A variable with no value is written as nothing and the block comes out anyway. If you do not want a half-empty block to come out, give it a condition (Exists).
- Only the exact form
{{name}}counts: with spaces inside,{{ price }}, it stays written as it is.
Display conditions
Conditions look at each offer's data and are organized in groups: Add group creates one with a condition, Add condition adds another to the same group, and Enter in the value box does the same. The trash can removes a condition or the whole group; a group left with no conditions disappears.
Each condition has three parts: the field (a variable), the operator and the value, which only appears when the operator needs it. The operators depend on the type of field:
| Operator | Number fields (Price, List price, Discount) | Text fields (the rest) |
|---|---|---|
| Exists / Does not exist | Yes | Yes |
| Equal to / Not equal to | Yes | Yes |
| Greater than / Less than | Yes | — |
| Contains | — | Yes |
Between conditions and between groups there is an AND or OR label that changes when you press it:
- Within a group the conditions start out with AND: the block comes out if all are met.
- A second group is joined to the first with OR to begin with: the block comes out if any of the groups is met.
- If you mix the two within a group, AND is resolved before OR:
a AND b OR cis “(a and b) or c”.
Examples
- Only on Amazon with more than 30% discount: in the same group,
Store·Equal to·AmazonANDDiscount·Greater than·30. - If the discount goes over 50% or the price drops below 10: both conditions and the label changed to OR.
- Only when there is a reduction:
List price·Exists. It is what the factory template does to choose between the “Price” block and the “Price with list price” block.
The traps that catch people out most
- Exists means “has a value and is not empty”. The title, the price, the URL and the discount always exist; the discount is 0 without a list price, so “Discount · Exists” is always met and what you want is “Discount · Greater than · 0”.
- Texts are compared as they are, case-sensitive: “Contains amazon” does not find “Amazon”.
- A value that is only digits is read as a number even if the field is text, so “Title · Contains · 2024” does not work. Use a word or add something else to the value.
- A half-finished condition does not let you confirm the block: a notice says “Fix the errors in the conditions” and, if what is missing is the value, its box is marked in red.
Validation
The editor checks the template every time it updates the preview. The problems appear above the list of blocks, with the block's name in front when it has one. The most common ones:
- A tag opened and not closed, or closed in a different order.
- A tag that Telegram does not accept, or an attribute that is not allowed.
- A link with no
href. - A variable that does not exist, or an unknown field or operator in a condition.
- No active block.
The amber notices do not stop you from saving: they tell you, for example, that {{title}} or {{url}} is not used in any active block, in case it is an oversight.
You cannot save with errors
With errors, Save warns —“Cannot save: fix the validation errors”— and takes you to the notices panel. Fix them and save again.
Save, discard and leave
- Save and Discard switch on with any change, including one of order or of a space.
- What you save also reaches the messages already waiting in that channel's queue: the queue applies the channel's template when it sends them; Publication queue explains it.
- Discard asks first and returns the template to how it was saved.
- If you try to leave the screen with pending changes —through the menu, the channel selector or the browser's back arrow—, you are asked: Leave without saving or Keep editing. If you close the tab or reload, the browser itself asks.
If somebody else or another tab saves at the same time
Anyone in the organization with access to the channel can edit and save its template. If somebody — or another tab of yours — saves it after you opened the screen, or you switched channel in another tab, pressing Save or importing warns you and nothing is saved: reload to see what was saved and make your change again.
Preset templates
opens the Preset templates panel. There is one, Default, which is the same one each channel is born with. Press Load and confirm: its blocks replace yours in the list.
Loading is not saving
The preset template is applied on screen: you can look at it in the preview and, if you are not convinced, press Discard to go back to yours. Only when you press Save is the previous one lost. Loading Default is the way to go back to the factory template.
The factory template, block by block
It has eleven blocks: Header ({{header}}, only if it exists), Title, Store (#{{store}}, only if it exists), Spacer (empty, with its two breaks), Description (only if it exists), Price (only without a list price), Price with list price (price and struck-through list price, only with a list price), Discount ({{discount}}%, only with a list price), Coupons (only if there are any), Link (<a href="{{url}}">Go to the offer</a>) and Footer ({{footer}}, only if it exists).
Export and import
- Export template downloads the saved template as
template.json. What you have unsaved is not in the file: save first. - Import template opens a window with the Template JSON box: paste there the contents of an exported file and press Import. It replaces all the blocks and, unlike the rest of the screen, it is saved straight away: there is no need to press Save afterwards. If what you paste is not a template, or has an error, the window says why above the box and nothing is imported.
It is useful for making backups, for taking a channel's template to another and for sharing it with another organization.
Keep a copy before experimenting
Exporting before loading a preset or redoing the template gives you a point to go back to.