function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Merging a URL field into a Custom HTML Email Template?

Hi everyone,

I'm setting up a custom html email template for a client to be sent in a scheduled manner to their Leads.  The Lead record contains a URL field called "Site Admin URL" ({!Lead.Site_Admin_URL__c}), and the values of this field are unique to each Lead record.  It also contains a calculated field "Site Admin URL (no prefix" ({!Lead.Site_Admin_URL_no_prefix__c}), which = the Site Admin URL value with its "http://" prefix.

We want to insert the value for the Site Admin URL as a merge field into the template, so when the submitter of the Lead receives an email based on the template, it appears as a live URL link to the path specified as the value to the Site Admin URL field in the Lead.

For some reason, we can't quite get the syntax right to make this happen.  For the approaches below, assume that Site Admin URL value = ""

We've tried:
1) <a href="{!Lead.Site_Admin_URL__c}">Click here</a>
But if the Site Admin URL value is "" this code produces a link in the final email that points to:

2) <a href="http://{!Lead.Site_Admin_URL_no_prefix__c}">Click here</a>
But if the Site Admin URL value is "" this code produces no link at all in the final email.

Perhaps this is a simple fix, but I don't know how to get the syntax right.  Any ideas?

Thanks in advance for your suggestions.
Jeff TalbotJeff Talbot
Any chance that the email creator doesn't have access to the calculated field?
Nope, unfortunately not.  The email creator is me, the administrator.
Jeff TalbotJeff Talbot

I'm not seeing a functional difference between your second example, and what I just got to work... but here is a copy of my html that worked. Please post if you discover what the problem was. Thanks.

<a href="hxxp://xxx.{Lead.Email_Domain__c}">Click here</a>


NOTE: For some reason, in the text above I had to sub hxxp for http and xxx for www in order to get the text to post to this discussion board as intended. Sorry.

Message Edited by TA_Invisible on 11-19-2007 10:57 AM

Amy Raisbeck RestrepoAmy Raisbeck Restrepo
Hello, I tried Jeff´s suggestion above with no luck, I entered this into my html template:

<a href="{!Case.Id}">Click here</a>

But when I receive the email I just get the whole thing (the link works!) but what I want is for the URL to be hidden so the email recepient can just see and click on a "click here" link.

This is the email I received with the code:

User-added image

Any feedback on whats wrong with my code?