Monday, 7 October 2013

Quick Fix :- How to build the URL to launch an Email template via Standard Screening



Case Study:

How to Create an email template that will Auto Fill the account, and primary contact when selected from the Send Email from the Opportunity Activity History panel.

Clicking on Send Email from there gives a blank window to send email from - How to fill them with information from the record which they are coming from

Solution :-

One click java-script to Send an email using standard emailing screen. See below :-

location.replace('/email/author/emailauthor.jsp?retURL=/{!Account.Id}&p24=<To Email Address>&template_id=<email template id>&p3_lkid={!Account.Id}&p3={!Account.Name}&p26=<from email address>&p5=&save=0');

Let us quickly analyze the URL Parameters :-

p2_lkid = it is "Email TO" Field Code , associated only with Contact ID of Contact Standard Object, populares the Contact in To Field of Email.

rtype = record type 001 means Account and so on

p3_lkid = whatId ( hidden lookup field) it is must if the merge fields are there in template

p24 = additional email to be added as addional

retURL = returning URL

p5 = stops adding more BCC

p26 = to change the domain from which you are sending

template_id - Email Template Id, It can have merge fields.

save = 0, means send the email automatically and return to retURL ,( leave it if you just need to see the screen with populated fields)

The aforementioned fields are standard fields provided from Salesforce side. These arent customizable but you can specify values for this as per your need and requirements. You can give merge fields values over there and that may help.

4 comments:

  1. how it can be done with lead object...can u give a URL for that?? thnxs.

    ReplyDelete
  2. Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
    Digital Marketing Training in Chennai

    Digital Marketing Course in Chennai


    ReplyDelete
  3. Explore the ultimate Garrys Mod game server experience! Host your own server for endless gaming fun with friends.

    ReplyDelete