Conditional placeholders

Placeholders are used in templates to customize email signatures or automatic replies based on the sender's information. In CodeTwo Email Signatures 365, there are two types of placeholders: regular and conditional.

Regular placeholders automatically fill in with an email sender's details (like job title and department) pulled from Entra ID / Azure AD. For example, the {First name} placeholder will display the sender's first name. If the data is not available in Entra ID, the placeholder will be empty, but you can avoid empty lines in your template by using RT tags. Regular placeholders can also include message details, a QR code, and more. See all available placeholders

Conditional placeholders change their content based on certain conditions (rules) you set. This means you can decide what appears in a signature / automatic reply in place of your placeholder (this can be text, images, HTML code) depending on email sender’s contact details, group membership, etc. Regular placeholders can be used within conditional placeholders as well.

You can use conditional placeholders to:

  1. Create a modular signature with dynamic (variable) content that changes based on the sender's information. See instructions
  2. Use an alternative phone number in the signature if sender's phone number is not listed in Entra ID. See instructions
  3. Include marketing banners in different languages based on sender’s Country attribute (as provided in Entra ID).
  4. Manage branding elements used in multiple signatures, like a company logo or banner, from a single place.
  5. Display a different office address based on sender’s City attribute.
  6. Add additional/custom information to the signature for certain users.
  7. Insert generic contact details when specific attributes are missing in Entra ID, instead of leaving placeholders empty (or using RT tags). And more!

Each conditional placeholder can have several rules, where each rule is made up of a condition based on the sender's Entra ID attributes and a placeholder value that will replace the placeholder (Fig. 1.). The email signature will include the value from the first rule that applies. If no conditions apply, a default placeholder value is used.

This conditional placeholder inserts a generic phone number if sender's phone number is not listed in Entra ID.
Fig. 1. This conditional placeholder inserts a generic phone number if sender's phone number is not listed in Entra ID.

Follow the links below to learn how to:

Create a new conditional placeholder

Conditional placeholders are created and managed in the Conditional placeholders manager. To open the manager, go to the template editor, click Conditional placeholder on the ribbon and select Manage (Fig. 2.).

Opening the Conditional placeholders manager.
Fig. 2. Opening the Conditional placeholders manager.

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

Conditional placeholders can be used across multiple templates. Because of their unique name, once you update a conditional placeholder in one template, the change will apply to all templates that include this placeholder (this does not apply to legacy conditional placeholders). That's why it's not possible to change the name of your conditional placeholders. However, you can use the clone (Esig365 - Conditional placeholders - clone icon) button to create a copy of any existing placeholder and name it differently.

Creating a new conditional placeholder.
Fig. 3. Creating a new conditional placeholder.

To delete a conditional placeholder, select it and click Editor - conditional placeholders - delete icon. Note that if this placeholder is used in other templates, it will stop working and will be replaced with a blank space in emails / automatic replies. 

Create a placeholder rule

Conditional placeholders consist of rules that are used to determine which value should replace the placeholder once an email or automatic reply is sent. 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.

Creating a new placeholder rule.
Fig. 4. Creating a new placeholder rule.

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 rules on the list.

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

Now you need to define conditions and placeholder values for your placeholder rule.

Define conditions for a placeholder rule

Click the  button in the Condition column to open the Placeholder rule conditions builder (Fig. 5.).

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

You can build rule conditions based on:

  • sender’s properties (email address, group membership, etc.),
  • Entra ID (Azure AD) attributes (City, Company, Phone number, etc.),
  • Exchange Online custom attributes (including CustomAttribute1-15),
  • attributes synced from on-prem Exchange Server,
  • CodeTwo custom attributes.

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 Shift key). For hints on how to use the Placeholder rule conditions builder, see the examples below.

You can configure conditions based on users included in the scope of licensed users only.

Example 1: building a simple rule condition

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

An example of a placeholder rule condition – the rule applies to all senders that belong to the Sales and Marketing group.
Fig. 6. An example of a placeholder rule condition – the rule applies to all senders that belong to the Sales and Marketing group.

Example 2: using the OR clause when building a rule condition

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.):

An example of a placeholder rule condition – the rule applies to all senders whose job title includes the word manager or director.
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: building a complex rule condition with multiple clauses

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 and Marketing group as well as to the user whose email address is [email protected] (this user doesn't need to hold a senior position or belong to the Sales and Marketing group).

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 and Marketing group as well as those whose email address is sales@example.com.
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 and Marketing group as well as those whose email address is [email protected].

Define conditional placeholder values

A placeholder value is what replaces the placeholder in an email signature / automatic reply, provided that the related condition is met. If none of the rule conditions set up for a placeholder are met, the default placeholder value will apply.

Click the  button in the Placeholder value column (or under Default placeholder value). This opens a drop-down menu (Fig. 9.) with all the available contents you can use.

A list of contents that can be used as conditional placeholder values.
Fig. 9. A list of contents that can be used as conditional placeholder values.

The following can be used as placeholder value:

Tip

A single placeholder value can contain multiple content types (e.g. two regular placeholders, a placeholder and a picture, two pictures, etc.) . 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 added to an email signature.

Regular placeholders

Regular placeholders are grouped into three categories: Message Sender, Message properties* and Other*, as shown in Fig. 9. These placeholders include sender’s Entra ID (Azure AD) attributes (e.g. City, Company, Phone number, etc.), as well as Message date, Message ID, Current date/time, and more. You can select multiple regular placeholders and separate them with commas, fixed text, or even use the <br> tag between them (however, the latter will change the placeholder value field to HTML content the next time you open the Conditional placeholder manager).

Learn more about regular placeholders available in CodeTwo Email Signatures 365

* Regular placeholders in the Message properties and Other categories – except for the Display name (e-mail's From field) and E-mail (e-mail's From field) placeholders – only work with cloud (server-side) signatures and auto-reply messages. 

The <Placeholder> as link (e.g. E-mail as link) and QR Code image placeholders are not available in the Placeholder value drop-down menu. To use these placeholders in a conditional placeholder, use the HTML content option instead and select them by clicking Placeholder on the ribbon of the Edit HTML Snippet window (see Fig. 11.).

Picture

If you want the conditional placeholder to be replaced with an image, select Picture 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  button to change its properties (Fig. 10.).

You can change the picture properties by clicking the … (ellipsis) button.
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

You can also use this option to reset the contents of the Placeholder value cell.

HTML content

Select HTML content to open the Edit HTML Snippet window (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.

The Edit HTML Snippet window is used to edit placeholder values.
Fig. 11. The Edit HTML Snippet window is used to edit placeholder values.

If you select a different content type in the Placeholder value cell (e.g. a placeholder or picture) and then select HTML content from the drop-down menu, the previously selected content will appear in the Edit HTML Snippet window as well (Fig. 12.). You can use the available tools to make additional changes to your value (e.g. apply bold formatting, change font size or color, etc.).

The Edit HTML Snippet window can be used to edit all objects used as placeholder values.
Fig. 12. All placeholder values can be further edited in the Edit HTML Snippet window.

After you finish configuring rules for your conditional placeholder, you should also define the Default placeholder value (the same way as described here). Once done, click SAVE (Fig. 13.) to apply your changes and make the placeholder available for use in the template editor.

Saving a conditional placeholder.
Fig. 13. Saving a conditional placeholder.

The program will notify you when it finds any issues with your placeholder (e.g. a missing placeholder value, as shown in Fig. 14.). However, if you left the value field blank on purpose, you can click SAVE CHANGES ANYWAY. Note that sometimes you won't be able to save your changes until you fix all issues. 

Tip

Make sure to use RT tags 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 Remove empty placeholder option

Esig365 - Conditional placeholders - Validator
Fig. 14. A validator checks if there are any problems with your conditional placeholders.

Insert a conditional placeholder

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

Inserting a conditional placeholder into a signature template.
Fig. 15. Inserting a conditional placeholder into a signature template.

You can use the Signature preview functionality to see how the conditional placeholder’s value changes as you select different users (provided that different conditions are met).

Edit conditional placeholders

You can edit all your conditional placeholders in the Conditional placeholders manager (see Fig. 1.). To edit a specific placeholder that's already added to your template, you can also right-click it and select Edit placeholder (Fig. 16.). This will open the Edit conditional placeholder window, where you can change the placeholder's conditions and values.

Editing a conditional placeholder by using the Edit placeholder option from the shortcut menu.
Fig. 16. Editing a conditional placeholder by using the Edit placeholder option from the shortcut menu.

Once you make your changes, click OK to apply them. Your changes will be applied to all templates (signatures and automatic replies) that include this placeholder. 

Legacy conditional placeholders

The above information about editing placeholders does not apply to legacy conditional placeholders. If you still use them in your templates, refer to this section to learn how to edit them.

Examples of use

How to insert different information to an email signature if a certain Entra ID (Azure AD) attribute is missing

By default, if a placeholder cannot be replaced with data pulled from Entra ID (e.g. since that data is missing), an empty space will appear in its place in an email signature or automatic reply (this empty space can be easily removed by using the Remove empty placeholder option). However, by using conditional placeholders, you can instead replace that placeholder with different data, e.g. a fixed value or information taken from another Entra ID attribute.

Conditional placeholders prove very useful in the common scenario illustrated below, where a different phone number is inserted into an email signature if the Phone attribute has no value specified in sender’s Entra ID. Follow the steps below to create a conditional placeholder for such a scenario: 

  1. Open the Conditional placeholder manager and create or edit a conditional placeholder (as described here).
  2. Click Editor - conditional placeholders - add rule icon above the Placeholder rules list to add a new rule.
  3. Click the  button in the Condition column to open the Placeholder rule conditions builder.
  4. Add the following condition:
    • Sender property > Phone
    • Operator > exists (Fig. 17.) and click OK.

Creating a condition that will apply to all users who have the Phone Entra ID attribute defined.
Fig. 17. Creating a condition that will apply to all users who have the Phone Entra ID attribute defined.

  1. In the Placeholder value column, click the  button and select: Message Sender > Phone & fax > Phone (Fig. 18.). That way, if a sender has the Phone attribute defined in Entra ID, this value will be inserted into an email signature. 

Selecting the Phone attribute as the value for the first placeholder rule.
Fig. 18. Selecting the Phone attribute as the value for the first placeholder rule.

  1. (Optional) If you also want the program to search for a phone number through other Entra ID attributes (Mobile, Home phone, etc.) and insert whatever can be found into an email signature, you can add additional rules, as shown in Fig. 19.

Adding more rules to the conditional placeholder.
Fig. 19. Adding more rules to the conditional placeholder.

Important

The rules are checked from the top to the bottom of the placeholder rules list, and the conditional placeholder will be replaced with the value of the first rule whose conditions are met.

  1. In the Default placeholder value field (Fig. 20.), click the  button, select Plain text, and provide a phone number (e.g. company's generic phone number). This phone number will replace the conditional placeholder in an email signature in case none of conditions defined in placeholder rules were met (so when an email sender has no phone number defined in any of the specified Entra ID attributes).

Esig365 - Conditional placeholders - Example of use 4
Fig. 20. Providing the default placeholder value that will replace the placeholder if none of the conditions are met when an email is sent.

  1. Click Save and then insert the conditional placeholder to your signature template(s).
  2. You can use the Signature preview functionality to check what the placeholder will look like when inserted to an email sent by different users.

Legacy conditional placeholders

Conditional placeholders created before the April 2024 app update are now considered legacy (read more about the update on CodeTwo blog). They will continue to work as usual in your templates but will not get any new updates. For the best experience, we recommend recreating all legacy placeholders as new ones by following these steps

If you want to continue using the legacy conditional placeholders, here's what you need to know:

  1. To edit a legacy placeholder that's already added to a template, right-click it and select Edit placeholder. This will open the Edit legacy conditional placeholder window, where you can modify placeholder rules, values, etc. (as shown in Fig. 21.). Note that your changes will apply to the current template only. If this legacy conditional placeholder is used in other templates as well, you need to modify all instances of the placeholder the same way.

Editing the legacy conditional placeholders.
Fig. 21. Editing the legacy conditional placeholders.

  1. To access all your existing legacy conditional placeholders, go to Conditional placeholders > Legacy placeholders in the editor (Fig. 22.). Click Manage (legacy placeholders) to open the Legacy conditional placeholders manager, where you can edit your legacy placeholders or create new ones. Note that changes made in the manager are not applied to legacy placeholders that are already inserted into your template(s) – you need to replace the modified legacy placeholder in each template. 

Accessing the legacy conditional placeholders.
Fig. 22. Accessing the legacy conditional placeholders.

If want the changes made to conditional placeholders to automatically apply across all placeholders in all your templates, start using the new conditional placeholders instead.

In this article

Was this information useful?