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
- How to insert different information to an email signature if a certain AD attribute is missing
- How to add randomly changing image links to emails (applies only to CodeTwo Exchange Rules and Exchange Rules Pro)
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:
- 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.
- Upload these graphics files to a web server and make sure that there are no viewing restrictions.
- In the signature template editor, you need to define personalized images by using AD attribute placeholders in the image source paths. Follow the steps below:
- Open the signature to which you would like to add personalized graphics.
- Select a place where the image should appear and click the Picture button on the toolbar. Learn more
- 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.
Fig. 1. Providing the address (URL) of an online picture.
- Click the </> Source button on the signature template editor's toolbar to open the HTML source code view of the signature.
-
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.
- Click Apply & Close in the source code view.
- Click the Preview button on the signature template editor's toolbar and choose any AD user to check the results.
- Finally, click Apply & Close in the editor to save the signature template.
Tip
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. Use the links below to learn how to use the Photo placeholder in:
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.
- Open the Conditional placeholder manager and create or edit a conditional placeholder (learn more).
- Click above the Placeholder rules list to add a new rule.
- Click the button in the Condition column to open the Placeholder rule conditions builder.
- Add the following condition:
- Sender property > Phone
- Operator > exists (Fig. 2.) and click OK.
Fig. 2. Creating a condition that will apply to all users who have the Phone AD attribute defined.
- In the Placeholder value column, click the button and select: Message Sender > Phone & fax > Phone (Fig. 3.). That way, if a sender has the Phone attribute defined in Azure AD, this value will be inserted into an email signature.
Fig. 3. Selecting the Phone attribute as the value for the first placeholder rule.
- (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.
Fig. 4. 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.
- In the Default placeholder value field, 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 (which means the sender has no phone number defined in any of the specified AD attributes).
Fig. 5. Providing the default placeholder value that will replace the placeholder if none of the conditions are met when an email is sent.
- Click Save and then insert the conditional placeholder to your signature template.
- You can use the Preview button to check what the placeholder will look like when inserted to an email sent by different users.