Skip to main content

Editing an E-mail Template

The e-mail editor is where the subject and body of an e-mail template are written, one language at a time, next to a live preview of the e-mail. It opens on a full page from the Edit action (or right after New template) on the E-mail Templates tab of a function. The same editor is used for tenant-wide e-mails under Administration > System E-mails; see System E-mails.

Templates are written in the Scriban template language used by the server: data appears as tags such as {{ model.recipient_name }} and translated sentences as {{ L "Key" }} calls. In the visual mode these tags are shown as readable pills and sentences, so most templates can be edited without writing any code.

Purposes of the E-mail Editor​

  • Changing the wording of an e-mail without touching code.
  • Inserting record, task, recipient and system values into the subject and body.
  • Printing related records as a table.
  • Checking the result in a preview and in a real mailbox before saving.
  • Writing a separate version for each language.
  • Returning to the content delivered with the product.

Steps to Edit a Template​

  1. Open Administration > Function Designs and open the function.
  2. Select the E-mail Templates tab.
  3. Open the row action menu of the template and click Edit.
  4. Choose the language tab to edit, change the Subject and the body, and check the preview.
  5. Optionally use Send test to receive the e-mail in your mailbox.
  6. Click Save. The editor closes and returns to the list.

The Editor Screen​

  • Back arrow: Returns to the template list.
  • Title: The template's name, its status tag (Default or Customized) and, as soon as something is changed, an Unsaved changes mark. Under the title, the sentence from the When is it sent column.
  • Restore to default: Shown when there is something to undo for the language being edited: a saved customization or unsaved changes. See Restoring to Default.
  • Write with AI: Drafts the body from a description. Shown only where the template is sent from the function's records (for example state notification templates); see Writing with AI.
  • Send test: Sends the template to an e-mail address.
  • Save: Saves the subject and body of the language being edited.
  • Cancel: Leaves the editor without saving.

When other functions also send this template, a warning above the language tabs says "This template is also used by: ...". Your changes will affect their e-mails too.

Language Tabs​

Each language keeps its own subject and body. The tabs show only the languages that have been written, plus the one the editor opened with. Add language in the tab strip opens a list of the other languages of the tenant; picking one adds its tab so that a translation can be started. The information icon at the end explains what happens in a language that has not been customized: the default template is sent and its text is translated automatically.

Subject​

The Subject line of the e-mail. It can contain variables, shown as pills. The field is shown only when the template has its own subject.

Visual and Code Modes​

A switch above the body selects how it is edited:

  • Visual: A rich-text editor. Variables appear as pills with readable names; a pill can be dragged to another position and removed with its ×. Loop and condition blocks appear as paired chips; removing one removes its partner too. Sentences that come from the translation resources are marked as linked text; their tooltip says "Text from the translation (...). If you edit it, it becomes fixed text and no longer follows the translation."
  • Code (HTML): The raw HTML and Scriban source, with the template tags highlighted. Use it for markup the visual editor cannot express.

Adding Variables​

  • Add variable: A searchable drop-down next to the mode switch. The chosen variable is inserted where the cursor last was, in the subject or the body.
  • Template fields: Opens the Template fields drawer, the reference of everything the template can use. It lists only the fields that carry a value when this e-mail is sent, and has three tabs:
    • Variables: The tags grouped as Record, Recipient, Task, System and Branding, with columns Tag, What it stands for, Type and Example. Records can be expanded to reach their fields; the search covers the branches you have opened. Each tag can be inserted into the content or copied.
    • Texts: The translated sentences ({{ L "Key" }} calls) the template uses, with their wording in the language being edited.
    • HTML blocks: Ready building blocks for an e-mail body: Content area, Heading, Paragraph, Detail table, Button, Divider, Link, Bulleted list, Bold text and Image (by absolute URL).

Lists as Tables (Loop Blocks)​

When a field that holds more than one record (marked List) is inserted, the Add list window opens: the field is printed as a table with one row per record. Choose the Columns and whether to Head the table with the column names, then click Add to template. The table is inserted as a loop block.

Preview​

The right half of the screen shows the e-mail as a recipient would see it, with sample data. Desktop and Mobile switch between the full width and a phone frame. The preview shows a sample sender and recipient, the subject and the body. The header and footer come from the shared corporate layout (Layout: Corporate (shared setting)) and are not part of the template. A value that the sample record does not have is marked "This record has no value in this field".

Sending a Test​

Send test opens a window with:

  • Recipient: The address the test goes to. Leave it empty to send it to your own address. The address must be valid.
  • Language: The language version to send; the language being edited is offered first.

The test is sent with sample data and the subject is prefixed with [Test]. The test uses the saved version of the template: if there are unsaved changes, the window warns that they will not appear. After sending, "Test e-mail sent." is shown.

Writing with AI​

Write with AI opens a window where you describe what the e-mail should say (for example: greet the recipient, give the record's code and name and list the related records as a table).

  • Build on what is already written: When ticked, the AI extends the current body instead of replacing it.
  • Write / Write again: Produces a draft. The AI uses only the fields this template can read; fields it could not find are listed as "These fields are not on the record and will stay empty".
  • Apply to template: Puts the draft (and a subject, when the AI wrote one) into the language being edited. This replaces the body of that language; nothing is saved until you click Save.

Restoring to Default​

Restore to default works on the language being edited:

  • If the language has unsaved changes only, it asks "Unsaved changes in this template will be discarded. Continue?" and returns to the saved content.
  • If the language has saved customized content, it asks for confirmation ("The template will be returned to its default content. Your changes will be deleted.") and deletes the customization; the default content applies again and "Restored to default" is shown.

Other languages are not affected.

Leaving with Unsaved Changes​

If you leave the editor with unsaved changes (back arrow, Cancel, a menu link), the editor asks "You have unsaved changes. Are you sure you want to leave this page?". Changes in other language tabs are kept while you switch between tabs, but only the language being edited is saved by Save.

Authorization and Access Control​

Topics related to authorization and access control are detailed under User Management and Authorization.

  • Function Designer: Required to open a template and read its fields.
  • Update a Function Design: Required to save, restore, send a test, build the sample preview and write with AI.
  • AI availability: Write with AI works only when AI is available for the tenant.

For tenant-wide e-mails, the permissions of System E-mails apply; see System E-mails.

Warnings and Error Messages​

  • Subject Required: "Subject cannot be empty."
  • Invalid Template: "The template syntax is invalid." The template cannot be saved until the Scriban syntax is corrected (for example a loop without its end).
  • Invalid Test Recipient: "Enter a valid e-mail address"
  • No Test Recipient: "A recipient is required for the test e-mail. Enter an address, or add an e-mail address to your account."
  • AI Instruction Missing: "Write what the e-mail should say first."
  • AI Draft Failed: "The template could not be written right now. Please try again, describing what you want in a little more detail."
  • Not Found: "E-mail template not found."

User Tips and Best Practices​

  • Preview Before Saving: Check both the desktop and mobile preview, then send a test to yourself.
  • Save Each Language: Save stores the language being edited; switch to each changed language and save it.
  • Prefer Variables to Fixed Text: Use the record's code, name and link variables so the e-mail stays correct for every record.
  • Edit Linked Sentences Deliberately: Once a translated sentence is edited it becomes fixed text and no longer follows the translation resources.
  • Use Restore to Default to Start Over: It removes only the selected language's customization.

Frequently Asked Questions​

Why Doesn't My Test E-mail Show My Latest Changes?​

The test sends the saved version. Save first, then send the test.

Why Is a Variable Empty in the Preview?​

The sample record has no value in that field. The real e-mail uses the value of the record that triggers it.

No. They come from the shared corporate layout applied to every e-mail and are not part of the template.

Why Is the Write with AI Button Missing?​

It is offered only for templates sent from the function's records, and it requires AI to be available for the tenant.