You might find yourself in a situation when you don’t want to prepare too many signature templates differing only in little details. In such case, using conditions can save you a lot of time.

Basically, conditions let you hide the variables (placeholders) that the users have empty. This means that you can use the same template for users that have e.g. work mobile phone and those who don’t. 

The easiest way to start using conditions is using the “Conditions” menu in the template editor.

Start by choosing the placeholder you want to edit. Now define the condition (“is empty” or “is not empty”) and the text (or HTML) that is displayed if the condition is met and optional text (or HTML) if it isn’t.

 

Example: Only some of your users have mobile phones. You don’t want this placeholder to be shown for people that don’t have them.

You choose the placeholder “Mobile”, the "Is NOT empty" option and enter the text e.g. "Mobile phone:".

After you click "OK", this string will be attached to your signature:

{if not empty(mobile)}Mobile phone:{/if}

Now you just need to add the actual placeholder to the string:

{if not empty(mobile)}Mobile phone: {mobile}{/if}

Now you've secured a way to display the mobile phone number only to those users that have this information filled. Of course, you can modify this to work with any placeholders we support.

How to skip a blank line caused by an undisplayed condition?

This can be a little bit tricky... If you know your way around HTML, just go to Source view and insert <br /> inside the condition like this:

{if not empty(mobile)}Mobile phone: {mobile}<br />{/if}

It will look like this in the template:

{if not empty(mobile)Mobile phone: {mobile}
{/if}

In some cases, you'll be succesful if you type it this way directly in the editor. But we can't guarantee that, there's a chance another piece of code might force its' way to the condition and break the design. The only sure way to do that is really in the Source view. 

Conditions nesting

If you dare, you can achieve great results with the conditions. For example this one: 

{if not empty (phone)}{phone}{/if}{if not empty (mobile)}{mobile}{/if}{if empty(phone) and empty(mobile)}{companyPhone}{/if}

This nested condition states that if the user doesn't have populated {phone} field, the {mobile} should be used instead. If even {mobile} isn't populated, the {companyPhone} will be used. 

Did this answer your question?