August 22, 2016

How to get Salesforce base url in Visualforce Email template?

Use the below method in the controller to get Salesforce base url in Visualforce Email template.

        public String getfullURL() {
        return URL.getSalesforceBaseUrl().toExternalForm();
}

fullURL variable can be used in the Visualforce Email Template.

Cheers!!!

1 comment: