0

I have a Visualforce Email template which is as below:

<messaging:emailTemplate subject="Pricing tool ticketing requested 
    {!relatedTo.S_TicketingTool__r.S_Price__r.Name} 
    {!relatedTo.S_TicketingTool__r.P_GateType__c}" 
recipientType="User" relatedToType="pkg__Approvals__c">
<messaging:htmlEmailBody >
  <h4>{!relatedTo.S_TicketingTool__r.P_GateType__c} has been requested for Pricing
  <br/>{!relatedTo.S_TicketingTool__r.S_Price__r.S_TicketingPriceIdentifier__c} 
      - {!relatedTo.S_TicketingTool__r.S_Price__r.Name}.<br/>. 
  <br/>
  Please review and approve the request here:  <br/>
  <apex:outputLink value="{!relatedTo.S_TicketingTool__r.Id}" id="theLink">
         {!relatedTo.S_TicketingTool__r.Name}
  </apex:outputLink>
  </h4>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

I am expecting the Link with apex:outputLink, However, it generates the email as below:

12345 - Pricing details.

Please review and approve the request here:
[a513O000000U89UQA0]12345 - Pricing details - 05.01.2023

Any help to get the Link would be highly appreciated. On a side note, this was working fine a few days before in my sandbox and was tested. It is not working only since very recently.

1 Answer 1

1

<apex:outputLink> value= has to render to a valid https:// address to the SFDC record defined by:

 {!relatedTo.S_TicketingTool__r.Id}

(which by the way, is the same as {!relatedTo.S_TicketingTool__c}

Since this is an email template, you can't use relative addresses as the user will be clicking on it outside of SFDC (from within their email client)

So, the value= attribute needs to be (see this answer):

{!LEFT($Api.Partner_Server_URL_560,
       FIND(".com/",$Api.Partner_Server_URL_560)+3)}/{!relatedTo.S_TicketingTool__c}"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .