+ Start a Discussion
yujohwan99yujohwan99 

How can I create a custom button that sends an email with a template?

I've read many posts and articles regarding URL hacking or using javascript, but I am unable to figure out how to get the button to work. I went through the Salesforce Developer Workshop on trailhead, so I am somewhat familiar with some of the jargon, such as fields, custom objects, etc. 

Currently, I created a detail page button called Send Email on my Speaker object, but I cannot make the button work. I have no clue as to where to start. 
Best Answer chosen by yujohwan99
NagendraNagendra (Salesforce Developers) 
Hi Josh,

Sorry for this issue you are facing.

Here's a good blog entry by Werewolf For more information on the above issue please check with below link from the success community. Please let us know if this helps.

Kindly mark this as solved if it's resolved.

Thanks,
Nagendra

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Josh,

Sorry for this issue you are facing.

Here's a good blog entry by Werewolf For more information on the above issue please check with below link from the success community. Please let us know if this helps.

Kindly mark this as solved if it's resolved.

Thanks,
Nagendra
This was selected as the best answer
yujohwan99yujohwan99
I followed the guide by Werewolf, but I received an "A problem with the Onclick Javascript Button for this button or link was encountered: Invalid or Unexpected Token" error. I'm also trying to figure out how to convert the button to show up on Lightning since I read that Javascript isn't supported. When I try using the Converter tool created by Salesforce, the conversion type is "Manual," and I can't figure out how to manually convert it.

This is the code I used for the button:

location.replace('/email/author/emailauthor.jsp?retURL=/{!Speaker__c.Id}&p3_lkid={!Speaker__c.Id}&rtype=003&p2_lkid={!Speaker__c.Id}&template_id=00XE0000000S3V9&p5=‘);

 
yujohwan99yujohwan99
Nevermind, I managed to fix the issue. Thank you.