Template variables
With variables you lay the foundation of the path to the desired fields of, for example, a relation and/or project.
There are two variables that you will use when developing or adjusting a template, namely:
- $data.email: To be used with email and memo templates.
- $data.letter: To be used with letters/documents and fax templates.
Links with entities
A relation, project or, for example, an employee is a so-called entity within the system.
The entity whose fields you want to use is placed behind the variables mentioned. Some examples:
- relation: For data of the linked relation (individual, contact or company).
- project: For data of the linked project.
- project.relation: For data of the relation (individual, contact or company) of the linked project.
- employee: For data of the employee who draws up the correspondence.
Linking fields
Once you have the path to the correct entity, you can link the desired field of this entity. You do this by placing the field name (template code) of the field behind the set path to the entity.
How to find out what template codes to use?
First, make sure that you have the following setting enabled – turn the switch on:
Settings ➤ Personal settings ➤ Personal ➤ Show template codes...
You can easily find out which template code is used for which field. For example, you open the page of a contact an press Edit. On this screen you will find the field First name, with the label in front of it (here the text ‘First name’ is displayed). When you move the mouse cursor over the label, a tooltip will appear (mouse over). In this tooltip you will find the template code. For First name this is ‘firstname’.
Example of a template code
The code $data.email.relation.firstname includes the full path to the first name of the relationship linked to the email.
If the field ‘first name’ is filled in for the linked relationship in your system, the value that is filled in in that field will appear in place of this code when composing the email.
Linking your company data
Settings ➤ Company settings ➤ Manage company data
Within your system you can manage your company data. You can have this data appear on your correspondence. The path to this data is made up of its own predefinition followed by the template code of the desired field.
The predefinition to this data is as follows: $data.companyInfo.mijnBedrijf. In this variable, no distinction is made between email or letter, it is always the same.
The template codes for the available fields can be found in the tooltip of the label. The template codes of the most frequently used fields can also be found in the overview Examples template codes.