All Collections
Format and conditions attributes
Format and conditions attributes

How to format attributes in your templates?

Updated over a week ago

In this article, we will see :

  • how to format an attribute (1st letter in upper case, etc.)

  • how to put conditions on attributes

For the fields in the text block, it is possible, for example, to integrate a suffix or a prefix. If the field is empty then it will not appear in the template.

1️⃣ Access the Templates menu

The attributes are accessible from your template editor: Create or select one of your templates.

2️⃣ Click on the text block

In your editor, click on the text block to bring up the Content menu.

3️⃣ Select the attribute

Select the attribute you want to include in your template and use our magic formulas.

⬇️ Details of the magic formulas

In order to manage the case of the first and last name, you must capitalize the attributes:

{{Firstname}} {{Lastname}}

will display Thomas DUPONT

{{Firstname}} {{Lastname}}

will display Thomas Smith

To check if one or more attributes are not empty:

{{if firstname}}{{lastname}}{{endif}} {{lastname}}

will be displayed only if first name is not empty.

{{mobile}}{{if mobile and phone}}-{{endif}}{{phone}}

will display '-' between tel and mobile if both are filled.

{{mobile}}{{if mobile or phone}}-{{endif}}{{phone}}

will display '-' between the tel and the mobile if one of them is filled.

{{if empty phone}}04 05 06 07 08{{endif}}

will be displayed only if telephone is empty.

{{if reply}}04 05 06 07 08{endif}}

will be displayed only in the reply signature.

{{if department like "marketing"}}Marketing & Communication{endif}}

will be displayed only if the attribute contains marketing.

{{if department like "{{title}}"}}Marketing & Communication{{endif}}

will be displayed only if the department attribute is equal to the "{{title}}" attribute.

{{if department not like "{{title}}"}}Marketing & Communication{{endif}}

will be displayed only if the department attribute is not equal to the "{{title}}" attribute.

4️⃣ The Conditions menu

You can use the attribute conditions drop-down menu to help you use these formulas.

5️⃣ Preview

Then, check the result with the Preview tab!

Did this answer your question?