Summary:

By default WWW URL fields added to an email template will not be hyperlinked. The article describes a number of methods of adding hyperlinks to these fields in email templates.

More information:

Normally, if a WWW URL field (such as comp_website) is added to an email template, it will appear as plain text. A hyperlink (<a> tag) will not be added unless a user edits email after selecting a template, and hits Return on the line containing the WWW URL field.

There are a number of options for adding hyperlinks to email templates, some of which provide more functionality than adding a basic <a> tag.

In these examples, we will be adding the Company Website (WWW URL) field to an email template on the Company entity. The email template's HTML can be edited directly by hitting the Source button:

source-button 

Example 1:

Add the following HTML:

Website: <a href=""></a>

Add your WWW field twice to the HTML, as below:

Website: <a href="#comp_website#">#comp_website#</a>

This will then display in the template as follows:

plain-hyperlink

Example 2:

This is slightly more interesting. This will still link to the same site, but the link will use text that stays the same across templates:

Website 2: <a href="#comp_website#" target="_blank">This is a link to a website!</a>

The target attribute sets the link to open in a new window.

hyperlink-custom-text

Example 3:

You could also use the <a> tag to add hyperlinks to other screen objects, such as images. Here’s how this is done:

Image link: <a href="#oppo_weblink#"><img src="http://myserver.com/img/picture.jpg"></a>

hyperlinked-image 

Clicking on the image will take you to the URL defined by the mail merge field.

Using this technique allows you to have full control over how URLs are presented (as in the examples above); you could also use a similar trick to pass custom parameters in marketing URLs. This would be useful for click tracking.