You need to sign in to do that
Don't have an account?
Sites domain name access in an email template
Is there a way to access the sites domain name in an email template?
i.e. I'd like to have a email that is sent on a workflow that will give a link to a sites page.
In development, the page would be something like:
http://XXX-developer-edition.na7.force.com/mysite/mypage
I would like to code the template something like
{!siteaddress}/mysite/mypage
so when moving to different environments I don't need to edit the tempate.
Or, is there a way to access a static Apex class method in an email template? This way, I could set the site address in the Apex class so at least if I have many e-mail templates I would only have one place to change it.
All that needs to be done is populate the field value on the custom setting in each environment, a task which an admin can do without the aid of a developer.
All Answers
How about using a Visualforce email template and then in the VF email template, create a custom component that uses a controller that returns the Site URL?
There is currently no way to dynamically get the Site URL if you're not in the context of a Site.
That would work.
However I was hoping to keep to the basic e-mail templates so a non-technical user could maintain them.
Hi,
From a site page I have to send site url through email template to my users. Is this possible without the help of Visual force email template?
Thanks in advance,
sorna
All that needs to be done is populate the field value on the custom setting in each environment, a task which an admin can do without the aid of a developer.