Use placeholders to create email signatures that adapt to the email sender
One of the most important features of CodeTwo's signature template editor is the ability to insert placeholders into email signatures. Placeholders are replaced with specific information (such as Azure Active Directory attributes/variables, message details, and more) when a signature is added to an email message. Instead of typing every signature detail manually, you can use CodeTwo software to pull variables such as the sender's name and contact data from AD. This way you can create signature templates that change dynamically depending on who sends an email, the current date and time, and so on. See the sections below to learn more.
- How to add or modify a placeholder
- What happens with my signature if a placeholder is empty?
- Available placeholders
- Examples of use
How to add or modify a placeholder
To add a placeholder into a signature template, select (click) a place inside your template where you want to add it, then click the Placeholder button on the ribbon and choose a placeholder from the list (Fig. 1.). Inserted placeholders are surrounded with curly brackets/braces { } to be recognized by the program. You can also add placeholders manually by typing their names inside braces ({Placeholder name}), but not all types can be added this way.
Fig. 1. How to add placeholders to a signature template.
Once a placeholder is added, you can modify its properties on the Placeholder tab (the tab appears when you click a placeholder) or by right-clicking it and choosing Edit placeholder from the shortcut menu. The available options depend on the placeholder, and not every property can be changed. Some settings are common for most placeholders. For example, the Formatting option allows you to specify the letter case of the AD attribute that will be inserted (Capitalize Each Word, lower case, UPPER CASE, etc., as shown in Fig. 2.).
Fig. 2. How to change the letter case of the AD attribute value pulled into a placeholder.
You cannot manually insert (by direct typing or copying and pasting) the following placeholders: Photo, Message date, Current date/time, Future date / due date and QR Code image.
These placeholders require additional configuration to be correctly recognized. If you add them manually, they will be treated as standard text. You need to insert them via the Placeholder button so that each of these placeholders gets a numerical ID (e.g. {Message date 1}). The editor remembers the added placeholders and their insertion order. So if you delete a placeholder added in this way and want to restore it, you need to type its name and ID manually (e.g. {Message date 1}) and the program will recognize it. To add another placeholder of the same type, use the Placeholder button again: the newly added placeholder will be numbered accordingly, e.g. {Message date 2}.
For more information on the placeholders listed above, see this section. Additional (custom) AD attribute placeholders are explained in section Available placeholders.
To see how placeholders look like when they are replaced with real data, use the Signature preview button. Learn more
What happens with my signature if a placeholder is empty?
There may be situations when a placeholder in an email signature cannot be replaced with information, for example because the related attribute in Active Directory has no value for the email sender. This leads to empty spaces in the signature layout. You can prevent this from happening by using the Remove empty placeholder option (RT tags) to automatically remove empty lines from your signatures.
Available placeholders
CodeTwo Email Signatures 365 supports all the single-value attributes available in Microsoft 365 (Azure Active Directory) and Azure AD Graph API. Multivalue Azure AD attributes are currently not supported (see this article to check if an attribute is single or multivalued). By default, the signature template editor shows placeholders with the most common Azure AD attributes as well as placeholders related to message properties, current date, etc. - you can see them in the table below. In some environments (such as hybrid deployments synced via Azure AD Connect), the list may contain more attributes (read on to find out more).
Also, if you create custom attributes with the User attributes manager, these will be available as placeholders as well. Learn more
Signature placeholders (variables) in CodeTwo Email Signatures 365 | |
---|---|
Message sender |
City, Company, Country, Department, Display name, E-mail, E-mail as link(1), First name, Initials(2), Last name, Notes(2), Office, P.O. Box(2), Pager(2), Photo(1), Postal code, State, Street, Title, Web page(2), Web page as link(1)(2)
|
Message properties(3) | Message date, Message ID, Message subject, Recipient address, Sending server |
Other | Current date/time(3), Future date / due date(3), QR Code image(1) |
(1) Available only in the HTML format.
(2) Exchange Online additional attribute (might require additional synchronization to be available).
(3) Available only in cloud (server-side) signature rules and autoresponder rules.
Important
Azure AD placeholders might not work right after you configure your signature rules for the first time or after updating Azure AD cache. This is because placeholder values are populated by cached data, not by data taken directly from your Microsoft 365 tenant.
A cache mechanism has been added to speed up message processing and prevent software from querying your Azure AD too often. The software automatically refreshes its cache every 20 minutes. You can manually update the Azure AD cache by accessing your Microsoft 365 tenant's settings in CodeTwo Admin Panel. Learn more
Exchange Online additional attributes
If you want to use additional Azure Active Directory attributes such as Initials, Home phone, or (in the case of hybrid environments) on-premises directory extension attributes in the signature template editor, these attributes need to be synchronized to CodeTwo Email Signatures 365. Otherwise, they are not available on the list of placeholders. Learn how to use Exchange Online additional attributes in our software
Conditional placeholders
Apart from using regular placeholders, you can also create conditional placeholder and add them to signature templates. Each conditional placeholder has one or more rules, and each rule consists of conditions and a value. When a signature is added to an email, each conditional placeholder is replaced with the value assigned to the first rule whose conditions are met. Learn more about conditional placeholders
Placeholders that require additional configuration
As explained earlier, some placeholders require additional configuration and that is why you cannot insert them by typing their names directly inside your template. Read on to learn more about them.
- The Photo placeholder
- The Web page as link placeholder
- Date and time related placeholders
- The QR Code image placeholder
The Photo placeholder
This placeholder is used by the program to pull your users' photos from Active Directory and insert them into emails as embedded pictures (click here to learn about the differences between embedded and linked images). Once you add it to your template, you can:
- insert photos in original dimensions,
- adjust the dimensions to a desirable size in pixels.
When customizing the size of your photo, the best practice is to type one dimension only and enter 0 (zero) as the other dimension (Fig. 3.). This way, the program will scale the photo keeping its original aspect ratio.
Fig. 3. The Photo placeholder's configuration window.
You can use our freeware application, CodeTwo User Photos for Office 365, to easily upload user photos to Azure Active Directory. Learn how to add user photos to signatures in CodeTwo Email Signatures 365
The Web page as link placeholder
This placeholder allows you to pull a web page address from your Azure Active Directory and insert it as a valid hyperlink. The web address value in your AD should be preceded by a proper protocol definition (like HTTP or HTTPS). If this information is missing, the program will automatically append the HTTP protocol to the very beginning of the link.
Date and time related placeholders
There are two placeholders that let you dynamically insert date and time information into your users’ email signatures:
- Current date/time – this placeholder is replaced with the current date (and time) of sending an email. Before placing the placeholder into the signature template, you need to choose the date format and time zone (Fig. 4.).
Fig. 4. The Current date/time placeholder configuration.
- Future date / due date – this placeholder is replaced with a future date (and time) that is calculated by adding the number of days (and hours) you specify to the exact date and time of sending an email (Fig. 5.). You also need to choose the date format and time zone.
Fig. 5. The Future date / due date placeholder configuration.
Tip
You can customize the date and time format for both the placeholders in many ways. For guidelines, see this article.
The QR Code image placeholder
This placeholder allows you to add a QR code image based on text or information pulled from your Active Directory to your signature template. When you configure this placeholder (Fig. 6.), you can type any text and/or add placeholders, and it will all be changed into a QR Code image. You can also change the size of the QR Code image based on the number of characters to be included. If you use placeholders, you need to remember that:
- Placeholders will be replaced with different values. These values (e.g. AD attributes) can sometimes exceed the number of characters allowed by the image size you selected. If this happens, the program will automatically increase the size of the inserted QR Code image. The maximum limit is 1476 characters. If you go beyond this limit, your text may be trimmed.
- You can change the properties of each placeholder by right-clicking it and choosing Edit placeholder.
- The Preview section always shows an image based on the current text. The QR Code image preview is based on placeholder names, not on their actual values. In your email, placeholder names will be replaced with values, and the generated QR Code image will change accordingly. In most cases, you can use the Signature preview button on the ribbon of the editor to see the real QR Code for a specific user.
Fig. 6. The QR Code image placeholder's configuration window.
See this Knowledge Base article to learn how to insert vCards as QR codes into email signatures.
Examples of use
Placeholders can enhance your emails in many ways. For example, you can use Azure 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 (online) images
If you want users to have personalized graphics (images, logos, etc.) in their email signatures, CodeTwo Email Signatures 365 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. For your images to work properly, make sure that there are no viewing restrictions and that the server is secured with an SSL certificate. In other words, the URL of the image needs to have a https prefix, not http.
- 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. 7.). Define the picture size, if necessary. Enter alternative text to improve the picture’s accessibility to the visually impaired. Finally, click OK.
Fig. 7. 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="https://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 Azure Active Directory
With CodeTwo Email Signatures 365, 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 this link to learn how to deploy email signatures with Microsoft 365 user photos.