+ Start a Discussion

How to put URL dynamically in HTML email template

How to put URL dynamically in HTML email template, i want to populate url dynamically otherwise on every instance i have to chance the URL.

Some one please suggest me what we have to do here.
Mahesh DMahesh D
Hi Karna,

There is an idea on this topic, please vote for it.


There is a workaround for that... you can create a formula field of type text and insert the following:

LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260))

That will give you the ORG''s URL ... than let's Say that you have created the formula field above with the name of "ORG URL",  so you can type in on the template the following:

<a href={!YourObjectName.ORG_URL__c}/{!Opportunity.Id}>{!Opportunity.Name}</a>

Just make sure you replace the YourObjectName with the name of the object where you are running the workflow... so if you need to link it into another object via the lookup relationship you can get the ORG URL field that you created and merge with the ID of that object to put the link together. 


Also look into below posts:








Please do let me know if it helps you.

Mark RootMark Root
Here's what I ended up doing, using the standard "Link" field that comes with whatever record you're working with:
{!MID(Task.Link, 1, LEN(Task.Link)-15)}{whatever_you_want}

In my case, this produced:

No need for a custom field, custom label, custom setting, or apex.
Sanjay Thakur 21Sanjay Thakur 21
Hi Mark,
This works for me
{!MID(User.Link, 1, LEN(User.Link)-15)}{!Target_User.Id}
Jithesh VasudevanJithesh Vasudevan
Brilliant. Thanks so much Mark Root and Sanjay Thakur. Your answer should be selected as the best answer. This totally works.