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
John EastvoldJohn Eastvold 

Contact Layout Custom Button

I'm trying to write a custom button for a contact page layout. Below is my desired code. I'm trying to initiate an email that will have a custom link URL in its body but the link has URL parameters which aren't working because the original mailto: has URL parameters so it's not being interpreted correctly. I've already tried using ASCII but it doesn't translate correctly. Any help or advice is greatly appreciated. Feel free to recommend an alternative solution for this implementation.

mailto:{!Contact.Email}?body=<a href="http://scholastica.tfaforms.net/217735?tfa_170={!Contact.Id}&FunnelNum={!Contact.Student_Master__Master_Application_Number__c}">Quick Survey</a>

 
Best Answer chosen by John Eastvold
Jasper WallJasper Wall

Hi John,
try the below code in your javascript,
 
location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=00X90000000EScf&p24={!Case.email_to__c}');


for more details see the below link
https://success.salesforce.com/ideaview?id=087300000006tqzAAA

Mark it as the best Answer if it helps,

Thanks,
Balayesu

All Answers

Jasper WallJasper Wall

Hi John,
try the below code in your javascript,
 
location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=00X90000000EScf&p24={!Case.email_to__c}');


for more details see the below link
https://success.salesforce.com/ideaview?id=087300000006tqzAAA

Mark it as the best Answer if it helps,

Thanks,
Balayesu
This was selected as the best answer
John EastvoldJohn Eastvold
Balayesu,

Thanks for pointing me in the right direction. I was able to create an email template that had the dynamic link that I needed and then use the location.replace to bring up the email template from the contact record.

Much Thanks,

John