Use placeholders to create email signatures that adapt to the email sender

This article applies to the web UI. If you use the desktop app (Manage Signatures App) to manage email signatures, see the related article for the desktop editor: Use placeholders to create email signatures that adapt to the email sender (desktop editor)

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

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.

How to add placeholders to a signature template.
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 (Fig. 2.).

How to change the letter case of the AD attribute value pulled into a placeholder.
Fig. 2. How to change the letter case of the AD attribute value pulled into a placeholder.

Important

You cannot manually insert (by direct typing or copying and pasting) the following placeholders: Photo, Message date, Current date/time 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.

Learn more about this feature

Available placeholders

CodeTwo Email Signatures for Office 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).

Signature placeholders (variables) in CodeTwo Email Signatures for Office 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)

Phone & fax:
Fax, Fax as link(1), Home phone(2), Home phone as link(1) (2), Mobile, Mobile as link(1), Phone, Phone as link(1)

Custom AD attributes:
CustomAttribute1-15
In hybrid environments, this list can also include extensionAttribute1-15 & other attributes synchronized via Azure AD Connect. Learn more

Message properties(3) Message date, Message ID, Message subject, Recipient address, Sending server
Other Current date/time(3), QR Code image(1)

(1) Available only in the HTML format.
(2) Additional attribute (might require additional synchronization to be available).
(3) Available only in server-side signature rules (learn more about signature modes in CodeTwo Email Signatures for Office 365).

Important

Placeholders might not work right after you configure your signature rules for the first time or after resetting Azure AD cache. This is because placeholder values are populated by cached data, not by data taken directly from your Microsoft 365 (Office 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 60 minutes. You can manually reset the Azure AD cache on the Manage tenant pages in CodeTwo Admin Panel. Learn more

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 for Office 365. Otherwise, they are not available on the list of placeholders. Learn how to use additional attributes in CodeTwo Email Signatures for Office 365

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

This placeholder is used by the program to pull your users' photos from Active Directory and insert them into emails. 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.

The Photo placeholder's configuration window.
Fig. 3. The Photo placeholder's configuration window.

Tip

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 for Office 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

You can customize the date and time format in many different 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. 4.), 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.

The QR Code image placeholder's configuration window.
Fig. 4. 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 for Office 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:

  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 signature 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. 5.). Define the picture size, if necessary. Click OK.

Providing the address (URL) of an online picture.
Fig. 5. Providing the address (URL) of an online picture.

  1. Click the </> Source button on the signature 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 signature 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.

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 for Office 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.

Was this information useful?