CodeTwo Base.title

Creating hyperlinks of any color using Active Directory variables with Rotating Text


Change the color of hyperlinks created with values from Active Directory.


See this section if you are using the following or newer versions CodeTwo Exchange Rules family software:

  • Pro 2.x
  • 2016 1.x
  • 2013 2.x
  • 2010 3.x
  • 2007 4.x

See this section if you are using the following or older versions CodeTwo Exchange Rules family software:

  • Pro 1.x
  • 2013 1.x
  • 2010 2.x
  • 2007 3.x

Solution for older versions of CodeTwo Exchange Rules software (Pro 1.x, 2013 1.x, 2010 2.x, 2007 3.x):

With the newer versions of CodeTwo Exchange Rules 2007/2010/PRO linked Active Directory fields such as email as link in template editor are blue by default. Users can change links font type, style and size, but color remains blue, as shown in the example in Fig. 1.

Fig. 1. Email as link dynamic fields remain blue in a default state despite applying color.

There is a workaround that allows changing color of the hyperlinks by "building" them from parts imported by Rotating text fields from external sources. If you are not familiar with the concept of creating hyperlinks using Rotating text fields please read this article before you continue.

For the purpose of this article let's say we want to insert into our footer an email address that is red instead of blue and is clickable. Normally, the signature would look like in the image Fig. 2.

Fig. 2. Simple signature with the E-mail Dynamic field.

However Dynamic field - E-mail does not create a clickable link and E-mail as link field is always blue. Also, Exchange Rules editor does not recognize an HTML "mailto" link. We need to use Rotating text fields which are located in the Dynamic field menu (Fig. 3).

Fig. 3. Location of the Rotating Text field in the upper menu.

We need to "build" an HTML "mailto" link from parts of the code located in external source - files on the hard drive and from E-mail Dynamic field (as Dynamic fields work only when inserted directly in the editor).

An HTML "mailto" link could look like this one:

<A style="COLOR: #ff0000;" href="mailto:{E-mail}">{E-mail}</A>


Everything in the code except for E-mail Dynamic fields must be imported from external files. Let's create a proper structure of Dynamic Fields in the editor as in the Fig. 4.

Fig. 4. Structure of the Dynamic Fields in the footer prepared for "mailto" link building.

Next we need to prepare appropriate folders and files structure as in the Fig. 5 as well.

Fig. 5. Folders and code source files structure on the hard drive.

Click on the first Rotating text field and using menu on the right point to a desired folder on the hard drive (Fig. 6).

Fig. 6. Linking {Rotating Text} fields with the code source files on the hard drive.

Save and close your editor and save your settings in the Administration module. Let's test our rule by sending a test email. Before that, make sure you have applied appropriate Conditions. The result should look more or less like this - link is red and clickable, works just like typical an HTML "mailto" link - Fig. 7.

Fig. 7. Signature with working red and clickable email address.

If you do not want the HTML "mailto" link to be underlined like the hyperlinks usually are, your hyperlink code must include "TEXT-DECORATION: none" attribute. So the full link code should look like this one:

<A style="COLOR: #ff0000; TEXT-DECORATION: none;" href="mailto:{E-mail}">{E-mail}</A>

Please be aware that the user Network Service must have appropriate permissions to the folder that stores your rotating text or rotating images folders and files. To do it, right click on the desired folder, choose Properties, Security tab and add Network Service user (Fig. 8) to the list with permission to Read & Execute (Fig. 9).

Fig. 8. Adding the Network Service user to the list of permissions.

Fig. 9. Adding appropriate permissions for the Network Service user.

Solution for newer versions of CodeTwo Exchange Rules software (Pro 2.x, 2016 1.x, 2013 2.x, 2010 3.x, 2007 4.x):

Open the editor, and then switch to the Source view.

Fig. 10. Switching to source code view.

Now, add the following code to the <body> section of signature:

<a href="mailto:{E-mail}" style="color: #f00;">Your text here</a>


  • mailto:{E-mail} stands for target of your hyperlink. You can also change it to any Web page address, e.g.
  • color: #f00; stands for your link color. You may also add more CSS attributes.
  • Your text here stands for visible text. It can also contain placeholders e.g. {E-mail}

After that you can switch again to the Designer view. Your link should now be red, as in the image below.

Fig. 11. Red hyperlink in Designer view.

You can also consider hyperlinking an image instead of standard text. To do so, please follow the steps below:

  1. Use Picture button on the Editor's ribbon and add your image.
  2. Open Source view.
  3. Click that image and on the Editor's ribbon choose Insert hyperlink.
    Fig. 12. Adding hyperlink.
  4. Provide the desired URL (e.g. without any placeholders at this moment.
  5. Open the Source view and find the A tag responsible for hyperlinking your image.
  6. To the href attribute add requested placeholders. Let us assume that the main address is and we have a user named Howard Wilford. If you set the href attribute to the following:
    <A href="{First name}.{Last name}">
    it will change during processing of a message into:
    <A href="">
    Add hyperlinked AD placeholder
    Fig. 13. Adding placeholders.
Our Clients: