The editor described in this manual is featured in the following CodeTwo products:

CodeTwo Exchange Rules Pro (product page | user's manual)

CodeTwo Exchange Rules (product page | user's manual)

Placeholders: examples of use

Placeholders can enhance your emails in many ways. For example, you can use Active Directory attributes to add personalized (user-specific) content to email signatures, or to create content that randomly changes with each sent email (such as marketing banners). Click the links below to learn about common usage scenarios.

How to add personalized images to email signatures

You can use AD attribute placeholders to enhance your email signatures with graphics (user photos, images, logos, etc.) that are added dynamically, depending on the person who sends a message. See guidelines for:

Hosted images

If you want users to have personalized graphics (images, logos, etc.) in their email signatures, CodeTwo software can do that for you. You only need to create a web storage location with images of all/some of your users. Our software can then insert these image files dynamically into emails sent by individual users. That way, a different graphics can be used for each user. To achieve this, you need to:

  1. Prepare individual graphics files for all/selected users and give these files names based on an AD attribute or attributes of your users. For example, you can use attributes such as First name and Last name in filenames (examples: John.Smith.png, Donna.Bell.png). Make sure to use the same filename pattern for all images. Remember that image filenames are case sensitive, and the letter case should be the same as the AD attribute value. You can use any image format, but it has to be the same for all pictures.
  2. Upload these graphics files to a web server and make sure that there are no viewing restrictions. 
  3. In the template editor, you need to define personalized images by using AD attribute placeholders in the image source paths. Follow the steps below:
    1. Open the signature to which you would like to add personalized graphics.
    2. Select a place where the image should appear and click the Picture button on the toolbar. Learn more
    3. Choose Online picture and provide the URL of any of the previously uploaded graphics files (see Fig. 1.). Define the picture size, if necessary. Click OK.

Editor - Insert online picture
Fig. 1. Providing the address (URL) of an online picture.

  1. Click the </> Source button on the template editor's toolbar to open the HTML source code view of the signature.
  2. Find the HTML element that inserts your image:

    <IMG border=0 src="http://my-image-source.domain/pics/John.Smith.png">

    and modify the image source address by replacing the filename with placeholders. For example, if your image file is Name.Surname.png (as in the sample code above), change it to {First name}.{Last name}.png. You can use the AD attributes button to insert placeholders.

  3. Click Apply & Close in the source code view.
  4. Click the Preview button on the template editor's toolbar and choose any AD user to check the results.
  5. Finally, click Apply & Close in the editor to save the signature template.


If you know HTML, you can insert images with placeholders instead of filenames directly in the source code view.

User pictures from the Photo attribute in Active Directory

With CodeTwo software, you can pull your users' photos from Active Directory, and insert these images into email signatures. In this way, each person can have their own profile photo added to messages. Learn more

How to insert different information to an email signature if a certain AD attribute is missing

By default, if a placeholder cannot be filled with user information, e.g. because this information is missing from the Active Directory, an empty space will appear in an email signature instead of the placeholder (this empty space can be easily removed using the Remove Text tag). However, it is also possible to replace that placeholder with different information, e.g. taken form a different AD attribute or with a fixed value. To be able to do so, you need to use conditional placeholders.

Conditional placeholders prove very useful in the common scenario illustrated below. Follow these steps to create a conditional placeholder that inserts a different phone number to an email signature if the Phone attribute has no value specified in sender’s AD.

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

Editor - Examples - Rule conditions builder
Fig. 2. Creating a condition that will apply to all users who have the Phone AD attribute defined.

  1. In the Placeholder value column, click the Editor - conditional placeholders - expand icon button and select: Message Sender > Phone & fax > Phone (Fig. 3.). That way, if a sender has the Phone attribute defined in Active Directory, this value will be inserted into an email signature. 

Selecting the Phone attribute as the value for the first placeholder rule.
Fig. 3. 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 AD attributes (Mobile, Home phone, etc.) and insert whatever can be found into an email signature, you can add additional rules, as shown in Fig. 4.

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


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, click the Editor - conditional placeholders - expand icon 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 (which means the sender has no phone number defined in any of the specified AD attributes).

Providing the default placeholder value that will replace the placeholder if none of the conditions are met when an email is sent.
Fig. 5. 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.
  2. You can use the Preview button to check what the placeholder will look like when inserted to an email sent by different users.

In this article

Was this information useful?