Knowledge Base

How to preserve spacing in AD fields

Problem:

You have an Active Directory field with some additional spacing in it, for example field Title: IT  Administrator that contains two spaces between "IT" and "Administrator". But when you send an e-mail, the placeholder Title is filled with just "IT Administrator", i.e. the additional space gets removed.

Solution:

HTML-rendering engines such as those in web browsers or email clients e.g. Outlook, by default treat this kind of spacing as a mistake and remove them. To force the spacing you would have to use HTML elements such as: &nbsp; or <BR /> . This is, however, not possible for AD fields. 

In this case you have to use the <PRE> tags around the AD placeholders in your signatures. Such a trick will preserve any user created spacing or line breaks. An example of the HTML code would look like this:

<PRE style="Font-Family: Arial; Font-Size: 10pt">
{Title}
</PRE>

Was this information useful?