Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Sunday 3 August 2014

Send Template Email to Custom object email field

Well Recently I was figuring it out to send email to a custom object email field through the list view page custom button. On click of the button it should open a small panel to select the Email Template and send it to the selected email.



Hmm pretty cool panel. But how to do it?
This is how I started,
1) Create a global class as follows. (Note :- You need to replace the "Person_Detail__c" object with your custom object and the "Email__c" field with your custom email field)



2) Created a List View button named "Send Email" on your custom object with content source as "onclick Javascript" option



3) Below is the Javascript code for the button. (Note:- In my case I used "Person_Detail__c" as custom object. You need to use your custom object instead of "Person_Detail__c")


That's it, now click on the "Send Email" button and send cool template emails to your recepients..