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
Suman MSuman M 

Land on a page on clicking a link in email template and log into salesforce


I'm woking on a requirment, where I need to have a link in Email template, on clicking the link, if the user is not looged into salesforce, then once he logs into salesforce, the user needs to be taken directly to page which the link is refering

I'm using a visualforce email template and my link is something like below.

<p>For email settings in community please click <a target="_blank" href="{!$Setup.MyPersonalSettings__c.Community_Base_URL__c}/VFPage">here</a></p>

currently if a user is already logged into salesforce/our commuinty then on clicking the link in email then the user is langing on the intended VF page, but this is not working if the user is logging into salesforce/commuinty on clicking the link.

Please help me with possible solution on this. Thank You
Akshay DeshmukhAkshay Deshmukh
Hi Suman,

Use this in your email template.

<a href=""> Please click here to view the record </a>

you can get id of the record from merge fields availble in email template.
Also, change the URL according to ORG instance. If it is production, change it to "".