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 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 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.
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:
- Create a new conditional placeholder
- Create a placeholder rule
- Insert a conditional placeholder
- Edit a conditional placeholder
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.).
Fig. 2. Opening the Conditional placeholders manager.
Click 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.
Fig. 3. Creating a new conditional placeholder.
To change the placeholder’s name or delete it, use the or 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 above the Placeholder rules list (Fig. 4.). Use the 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.
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 and 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 button in the Condition column to open the Placeholder rule conditions builder (Fig. 5.).
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.).
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.):
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 [email protected] (but who doesn’t necessarily hold a “senior” position or belong to the sales group).
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 [email protected].
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 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.
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*, Dynamic content**, Counters** and Other* objects in the placeholder value drop-down menu let you select regular placeholders, such as sender’s 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 software
* The Message properties and Other objects are available only for server-side signature rules in CodeTwo Email Signatures for Office 365.
** The Dynamic content and Counters objects are available only in CodeTwo Exchange Rules and CodeTwo Exchange Rules Pro.
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 button to change its properties (Fig. 10.).
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.
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.).
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.).
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.).
Fig. 14. Inserting a conditional placeholder to a signature template.
Notice that once you insert a conditional placeholder into your template, it gets a numerical ID, e.g. {Marketing banner 1}. When you insert the placeholder again, it will be numbered sequentially, i.e. {Marketing banner 2}. This is important when editing placeholders, as changes made to {Marketing banner 1} will not be applied to {Marketing banner 2} and the other way around. Learn more
Important
A conditional placeholder will only work if inserted from the ribbon. Typing its name in the template will not work (even if you surround the conditional placeholder’s name with curly braces).
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
To edit a conditional placeholder inserted into a signature template, right-click the placeholder and select Edit placeholder (Fig. 15.). Be sure to click OK to apply your changes.
Note that this allows you to change the conditions and values of this specific instance of the conditional placeholder only (e.g. {Marketing banner 1}), in the signature template that is currently being edited. When you add the conditional placeholder again to the same template (in which case it will be numbered accordingly, e.g. {Marketing banner 2}) or use the placeholder in another template, you need to apply the necessary changes to these new instances as well.
Fig. 15. Editing a conditional placeholder by using the Edit placeholder option from the shortcut menu.
It is also possible to edit conditional placeholders (change their names, conditions and values) in the Conditional placeholders manager (Fig. 2.). However, 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 remove the placeholder from the template and insert it again.
Important
If you have used this conditional placeholder in other templates as well, you need to update (reinsert) it everywhere. Note that when the conditional placeholder is inserted again, the next consecutive number is added to its name (Fig. 16.).
Fig. 16. Each conditional placeholder added to a signature template is a separate instance and has a different, consecutive number added to its name.