Setting Up Custom Email Templates
The custom email templates feature can be found in the menu Tools - Custom Email Templates.
The form contains a list of all email templates that can be attached to document types (or payroll updates). When sending, the document will be sent with the text of the selected template. If no template is selected, the default text will be used. Custom email templates are available for Premium licenses only.
To use a template, you must first create it in the menu Tools - Custom Email Templates. Click the New button and fill in any Abbreviation and Template Name. If you need to enter the name in multiple languages, click the + button and fill in the foreign language translation.
Template Tab
Basic Information
In the empty Template field, enter the desired text. To have data change with each document, you can use so-called Freemarker variables. These variables are part of the Java templating language in which the ABRA Flexi application is programmed. Without these variables, defining custom templates is not possible. Variables are enclosed in curly braces { } and always prefixed with the $ symbol:
${application} - the application name, i.e., "ABRA Flexi"
${user} - the user object, which can be further used
${company} - Company settings
- In email templates, it is now possible to display any field from the company settings; the description can be found at: server/c/firma/nastaveni/properties
${uzivatelJmeno} - Your first name
${uzivatelPrijmeni} - Your last name
${titulJmenoPrijmeni} - Your full name, including academic titles
${nazevFirmy} - Company name
${object} - general access to the passed object
${doklad} - the document to be sent
If you need, for example, the phone number of the user sending the email, use the variable $(user) modified to ${user.mobil}. Always refer to the variables of the given record at server/c/firma/evidence-list:
(If your company is called Zahradnictví and the address of your server, where you normally connect and where your license is also purchased, is zahradnictvi.flexibee.eu, enter the following in your browser: zahradnictví.flexibee.eu/c/zahradnictvi/evidence-list)
If you need the user record, the object in Freemarker is "user". An example is the mobile number of the logged-in user mentioned above: ${user.mobil}
You can also view general variables on the demo version, for example: https://demo.flexibee.eu/c/demo/faktura-vydana/properties
Variables can be nested; for example, if you need the due date of a specific invoice, use the variable:
${doklad.datSplat}
If you want the total amount on a specific invoice, use the variable:
${doklad.sumCelkem} etc.
If you want to include the date of, for example, the 1st reminder, check the properties and you will find that the variable for the 1st reminder is datUp1. Proceed in the same way as described above: ${doklad.datUp1}, for the 2nd reminder ${doklad.datUp2}, or for a settlement attempt ${doklad.datSmir}:
Instead of the doklad variable, you can also use the object field, i.e., ${object.datUp1}.
Using Fields from Related Records
Similarly to the fields of the object itself, you can also work with objects in related records. For issued invoices, for example, with their line items.
If you want to include, for example, the amounts of individual line items in an issued invoice, the notation would look like this:
Dobrý den, zasíláme vám fakturu s položkami ve výši:<br/>
<br/>
<#list object.polozkyFaktury as x>
${x.sumZkl}<br/>
</#list>
Result
Below you can see what a configured template using Freemarker variables might look like.
Tip for entering templates: The template can be entered in HTML, so you can use basic HTML tags for text formatting, such as line break <br/>, paragraph <p></p>, and more.
After sending, the variables will be replaced with actual values, and the email will look like this:
Usage Tab
On the Usage tab, select which documents you want to use the template for by checking the checkbox next to the relevant field. If you have one template for all document types, it is sufficient to check the record for which it applies in the template settings — there is no need to define it on the document type itself.
Texts Tab
The fields on the Texts tab are for informational purposes only and serve as an internal description or note for the given template — for example, to improve clarity or facilitate team communication.
Settings Tab
On the Settings tab, you can set the email subject. Please note that the Sender field is currently not functional.
Freemarker variables can also be used in the email subject.
Assigning a Template to a Document Type
Now assign the template to a specific document type. Document types can be found in each record, for example, Sales - Document Types - Issued Invoice Types. Open the relevant document type and on the Texts on Document tab, select the template to be used for all invoices of that type.
A configured template always takes precedence over the text entered in the Send Document Text field…
For information on using email templates when sending payslips, see: Sending Payslips via SMTP | ABRA Flexi (flexibee.eu)

