Speed and efficiency are very important to a business.
In Salesforce, if a user wants to send a quick email to a lead via a predefined template, here is the long list of steps:
- Open lead page
- Click on “send an email” button
- In the new page, click “select template” button
- Pick the desired email template in a new pop up
- Possibly also need to change from user to an organisational email address
Is there a way to shorten the process and cut step 3 – 5 ?
Certainly, we can build a custom button on the record detail page which automatically fills all necessary fields in send email page for us.
Here is how it’s done:
Firstly, find the email template id from the URL https://<instance>.salesforce.com/<your email id>.
Then, (I use Google chrome browser) go to the standard send email page and right click on the from field, choose “inspect”.
Exam the highlighted id in the browser console (in this case we have ID p26).
Expand the selection and find the desired email address and copy the whole value for that option.
By now we have got all the building blocks we need to hack the URL.
The last step is to build the custom URL for our button. We can build this by modifying the current page URL (send email):
Simply change https://<instance>.salesforce.com/_ui/core/email/author/EmailAuthor to https://<instance>.salesforce.com/_ui/core/email/author/EmailAuthor?p26=<the value you collect above>&template_id=<template id you copied from your template url> .
Try hitting enter, see the same page reloads with required fielded prefilled?
We can also extend the power of this method by including more ‘ids’ in the url, for example to auto CC someone in your company (&email@example.com for example).
That’s it for today, hope this tutorial inspires you.