Conditional placeholders

There are two types of placeholders available in the Signature Template Editor: regular and conditional.

A regular placeholder is replaced with a value based on the message sender (pulled from Azure AD) or message properties, current date, etc. For example, the {First name} placeholder will change into sender’s first name. If the value is not available (e.g. user’s AD attribute is missing), the placeholder will be empty (note: you can use RT tags to remove empty lines). Learn more and see all available placeholders

A conditional placeholder can be replaced with one of many values, depending on a set of user-defined rules (conditions). In other words, you assign multiple values to a conditional placeholder and specify when each of these values should replace this placeholder. The value that replaces a conditional placeholder can be anything from a single plain-text phrase or image to a piece of HTML code. You can use regular placeholders as conditional placeholders’ values as well.

Conditional placeholders can be used to:

  • insert another phone number to an email signature if a sender has no phone number specified in Active Directory (learn more),
  • insert marketing banners in different languages, depending on e.g. senders’ Country attribute in AD,
  • insert different office addresses, depending on e.g. the City attribute,
  • insert custom information in an email signature for selected users only,
  • insert generic contact information when corresponding attributes are missing in AD (instead of removing empty placeholders by using RT (remove text) tags),
  • and many more.

Each conditional placeholder can have multiple rules defined, and each rule consists of a condition and placeholder value (Fig. 1.). Conditions are built using email sender's Azure AD attributes. Only one value is inserted into an email signature, depending on which condition is met first. If none of the conditions defined in the placeholder rules are met, the default placeholder value is used.

Editor - Conditional placeholder example
Fig. 1. This conditional placeholder inserts a generic phone number if an email sender has no phone.

Follow the links below to learn how to:

Important

Currently, conditional placeholders are only available in CodeTwo Email Signatures for Office 365.

Create a new conditional placeholder

Conditional placeholders are created and managed in the Conditional placeholders manager. To open the manager, click the Placeholder button on the ribbon and select Conditional placeholders > Manage (Fig. 2.).

Editor - Opening conditional placeholders manager
Fig. 2. Opening the Conditional placeholders manager.

Click Editor - conditional placeholders - add rule icon above the Placeholders list to create a new conditional placeholder (Fig. 3.). Make sure to provide a unique name for the placeholder. The program will notify you if you enter a name that is already used by another placeholder, either regular or conditional.

Editor - New conditional placeholder
Fig. 3. Creating a new conditional placeholder.

To change the placeholder’s name or delete it, use the Editor - conditional placeholders - rename icon or Editor - conditional placeholders - delete icon button, respectively, or right-click the placeholder on the list and select what to do with it.

Create a placeholder rule

Placeholder rules contain all conditional values of the placeholder. To create a new rule, click Editor - conditional placeholders - add rule icon above the Placeholder rules list (Fig. 4.). Use the Editor - conditional placeholders - delete icon button to remove unnecessary placeholder rules. A placeholder rule comprises a condition that has to be met and a placeholder value that will be used if the condition is met. 

Editor - New conditional placeholder rule
Fig. 4. Creating a new placeholder rule.

Important

The order in which the rules appear on the Placeholder rules list is important. The program checks each rule from the top to the bottom of the list and replaces the placeholder with the value of the first condition that is met. Use the Editor - conditional placeholders - move up icon and Editor - conditional placeholders - move down icon buttons to change the position of the rule on the list.

You can use this feature to your advantage. Check this example of use for more details.

To get a conditional placeholder to work, you need to take the following steps:

Define conditions for a placeholder rule

Click the Editor - conditional placeholders - ellipsis icon button in the Condition column to open the Placeholder rule conditions builder (Fig. 5.).

Editor - Placeholder rule conditions builder
Fig. 5. Opening the Placeholder rule conditions builder.

Conditions are based on sender’s properties, such as email address, group membership or AD attributes, such as City, Company, Phone number, etc.

You can create complex conditions by inserting additional AND or OR clauses or by grouping clauses with the GROUP button (select multiple clauses while holding the Ctrl or Shift keys).

Important

You can only define conditions (not exceptions) for the placeholder rules. If you need to exclude specific users from getting certain elements in their signatures (like banners), you can do so by creating separate signature rules (signature templates) and determining which users should have access to them when configuring these rules.

For some hints on how to use the Placeholder rule conditions builder, see the examples below.

Example 1

This simple condition will trigger the placeholder rule if an email sender belongs to the sales group (Fig. 6.).

Editor - Rule builder example 1
Fig. 6. An example of a placeholder rule condition – the rule applies to all senders that belong to the sales group.

Example 2

For the rule to be applied only when senders hold higher or top managerial positions (e.g. manager or director), you can build the following conditions (Fig. 7.):

Editor - Rule builder example 2
Fig. 7. An example of a placeholder rule condition – the rule applies to all senders whose job title includes the word manager or director.

Example 3

The combination of conditions shown in Fig. 8. will apply the placeholder rule to the senders that occupy a senior job position and are members of the sales group as well as to the user whose email address is sales@example.com (but who doesn’t necessarily hold a “senior” position or belong to the sales group).

Editor - Rule builder example 3
Fig. 8. An example of a placeholder rule condition – the rule applies to all senders whose job title includes the word senior and who belong to the sales group as well as those whose email address is sales@example.com.

Define conditional placeholder values

A placeholder value is what the program inserts into an email signature in place of a conditional placeholder. The Conditional placeholder manager allows you to define:

  • an indefinite number of conditional values, i.e. values that will be used only if certain rule conditions are met;
  • a default placeholder value, which will replace the placeholder in an email signature if none of the conditions set out in the placeholder rules are met.

To select the value, click the Editor - conditional placeholders - expand icon button in the Placeholder value column (or under Default placeholder value). This will open a drop-down menu (Fig. 9.) with all the available objects you can use.

Editor - Conditional placeholder values
Fig. 9. A list of available objects that can be used as conditional placeholder values.

The following objects can be used as placeholder value:

Tip

You can define multiple objects (e.g. two regular placeholders, a placeholder and a picture, two pictures, etc.) as a single placeholder value. However, if you plan to do so, it would be a good idea to use the HTML content option, which gives you more editing options and a better view of how the placeholder value will look like when inserted to an email signature.

Regular placeholders

The Message Sender, Message properties* and Other* objects in the placeholder value drop-down menu let you select regular placeholders, such as sender’s Azure AD attributes (e.g. City, Company, Phone number, etc.), Message date, Message ID or Current date/time. You can insert multiple placeholders as well as separate them with, for example, commas and static text. You can also use the <br> tag between them (however, this will change the placeholder value field to the HTML content the next time you open the Conditional placeholder manager).

Learn more about regular placeholders available in CodeTwo Email Signatures for Office 365

Info

CodeTwo Email Signatures for Office 365 allows you to use your custom attributes (Directory extension attributes) as well. However, you first need to synchronize them with the program by using the Custom Attributes Sync App. Learn more

* The Message properties and Other objects are available only for server-side signature rules. 

Picture

If you want the conditional placeholder to be replaced with an image, select the Picture object from the drop-down menu. This will open the same window that is used to insert images to email signature template (learn more about the Insert picture option). After you select the image, you can use the Editor - conditional placeholders - ellipsis icon button to change its properties (Fig. 10.).

Editor -Conditional placeholder picture properties
Fig. 10. You can change the picture properties by clicking the … (ellipsis) button.

Plain text

Select Plain text if you want to use static text as a placeholder value.

Tip

This object can be also used to clear the Placeholder value cell of any objects defined earlier.

HTML content

The HTML content object opens the Conditional placeholder value editor (Fig. 11.) that looks like a simplified version of the signature template editor. This simplified editor also has most of the options used to create full-featured email signature templates.

Editor - Conditional placeholder value editor
Fig. 11. The Conditional placeholder value editor.

If you select another object in the Placeholder value cell (e.g. a placeholder or picture) and then select HTML content from the drop-down menu, this object will appear in the Conditional placeholder value editor as well (Fig. 12.).

Editor - Placeholder value editor example
Fig. 12. The Conditional placeholder value editor can be used
to edit all objects used as placeholder values.

After you finish configuring a conditional placeholder, click Save in the Conditional placeholders manager to apply your changes and make the placeholder available for use in the signature template editor. The program will notify you when it finds any issues with your placeholder (e.g. missing values). However, if you left the value field blank on purpose, you can click Save changes anyway (Fig. 13.).

Editor - Conditional placeholders validator
Fig. 13. A validator checks if there are any problems with your conditional placeholders.

Tip

Make sure to use Remove Text tag together with your conditional placeholder. That way, if the placeholder has no value, the program can remove the empty space from the email signature. Learn more about the {rt} tag

Insert a conditional placeholder

After you created a conditional placeholder, you can insert it into your email signature template. To do so, first place the cursor in the signature where you want to insert the placeholder. Next, select Placeholder > Conditional placeholders on the ribbon and click the name of the conditional placeholder you want to use (Fig. 14.).

Editor - inserting conditional placeholder
Fig. 14. Inserting a conditional placeholder to a signature template.

You can use the Preview functionality to see how the conditional placeholder’s value changes as you select different users and when different conditions are met.

Edit a conditional placeholder

There are two methods of editing conditional placeholders, and each method has a different use. You can edit conditional placeholders:

  • In the Conditional placeholders manager (Fig. 4.), where you edit conditional placeholder templates that can be used in other signature templates as well. This method allows you to change names, conditions and values of all your conditional placeholders.

    Important

    If you insert a conditional placeholder to a signature template but then make some changes to this placeholder in the Conditional placeholders manager, the inserted placeholder will not be updated with your changes. You need to insert this placeholder again.

  • By using the Edit placeholder option, available when you right-click a conditional placeholder inserted in a signature template (Fig. 15.). This method lets you edit conditions and values (but not the name) of a single instance of a conditional placeholder, and only for the currently edited signature template. This means that if you make changes to a conditional placeholder by using the Edit placeholder option, these changes will not be reflected in the Conditional placeholders manager.

Editor - Editing a conditional placeholder
Fig. 15. Editing a conditional placeholder by using the Edit placeholder option from the shortcut menu.

Was this information useful?