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
RajnisfRajnisf 

Link to record does not work in visualforce email template

Hi
i am using the following code for opportunity link in visualforce email template:
Link to Opportunity: &nbsp; <apex:outputlink value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+relatedTo.Id}"><apex:outputtext value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+relatedTo.Id}"/></apex:outputlink> 
in test email it works fine but in actual email it does not displacy {!ralatedTo.Account.Name} and link is also converting to secure.force.com
 https://abc.secure.force.com/0061K00000bNllxQAC

any help is much appreciated.

Thanks
Rajesh3699Rajesh3699
HI,

I think the apex:outputText value to be corrected to {!ralatedTo.Account.Name} ( from relatedTo.Id ) 

Also, this might help,
https://salesforce.stackexchange.com/questions/40072/vf-email-template-detail-link

Thank You,
Rajesh Adiga P.