You need to sign in to do that
Don't have an account?
Sumant Kuchipudi
How can we get Salesforce Base URL in email template?
Hi,
I'm bulding an Approval process, for that I'm preparing an email (Text) template to include VisualForce page link so that approvars opens that page and submit. I can get the Salesforce Base URL from apex but I have no clue how to get it form email template.
See the following template that I have gotten from APEX.
I'm bulding an Approval process, for that I'm preparing an email (Text) template to include VisualForce page link so that approvars opens that page and submit. I can get the Salesforce Base URL from apex but I have no clue how to get it form email template.
See the following template that I have gotten from APEX.
<a href='https://'+ System.URL.getSalesforceBaseUrl().getHost() + '/apex/GUGocardPhotoApprovalPage?ContactId='+contactID'>Click here </a>
Just remove https: and also change .getHost() with .ToExternalForm()
Thanks
It's not working for img src in email template, Can u suggest please?
<img src="'+System.URL.getSalesforceBaseUrl().ToExternalForm() +
'/servlet/servlet.ImageServer?id=0151200000323j&oid=00DA0000232&lastMod=142661854233"
alt="#1 in customer satisfaction over all other cable and satellite providers(4)" width="147" height="142" style="display: block;" border="0">
Thanks,
Rahul
There's a community ticket asking for this - go there and add your vote, but don't hold your breath waiting for an answer.
The ticket is already 7 years old!
https://success.salesforce.com/ideaView?id=08730000000b3PjAAI
There's a community ticket asking for this - go there and add your vote, but don't hold your breath waiting for an answer.
The ticket is already 7 years old!
https://success.salesforce.com/ideaView?id=08730000000b3PjAAI
{!MID(Task.Link, 1, LEN(Task.Link)-15)}{whatever_you_want}
In my case, this produced:
https://marine-dev-ed.my.salesforce.com/{whatever_you_want}
No need for a custom field, custom label, custom setting, or apex.
{!Case.Link}/../{whatever_you_want}
The assumption here is that moving one level up (the /../) from the Case URL, or whatever record Link, will get you to the Base URL. Works like a charm, in my case at least.