You need to sign in to do that
Don't have an account?
Naruto
Add Hyperlink To Body Of Email In Apex Code without URL
I want to provide hyperlink in the apex email body without displaying the url and html tag
from the above code, I am able to get an email with hyperlink but the hyperlink is not only applied to the 'displayname'. The email body even has the html tag and the complete URL in the hyperlink.
How to provide the hyperlink only to displayname and hide the URL
message.subject = 'some subject'; emailBody += '<html><a href="'+URL.getSalesforceBaseUrl().toExternalForm()+'/'+someid+'">'+displayname+'</a></html>';
from the above code, I am able to get an email with hyperlink but the hyperlink is not only applied to the 'displayname'. The email body even has the html tag and the complete URL in the hyperlink.
How to provide the hyperlink only to displayname and hide the URL
Please follow this link, it will help you,
https://developer.salesforce.com/forums/?id=906F000000094F2IAI
Thanks,
Just try below sample code, Thanks,