• Sarthak Bhatnagar
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I have an Apex class that I am using as a custom controller to send an email from a VF page. In that class I have constructed the email subject and body to have predefined text but the user still has the option to edit/add on to it on the VF page.
PROBLEM: I am trying to add a link to the email body in the constructor in the Apex class so that the person receving the email can directly go the record that the email is refering. 

This is an example of the body text: 
String body = 'Hi ' + Contact.FirstName + ', \n' + 'This is the account I am talking about + (hyperlink) acc.Name +  ' Lets discuss some more." 

I have tried constructing a string with an href: 
String link = '<a href="https://www.surveymonkey.com>' + acc.Name + '</a>';

But that just prints the whole string, along with the link, and doesn't make the acc.Name hyperlink. 
I also tried adding a commandLink on the VF page between the body tags but that doesn't work either. 
Any input is appreciated.