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
mikeegarmikeegar 

Email URL Parameters Not Working With Custom Object and Lead Recipient

Hi Folks,

It should be possible to default the related object and recipient fields using email URL parameters e.g. open up the standard email page with an email template using merge fields from a custom object and a lead as a recipient. This does not appear to work. It does work for contacts however.

With a custom object and a lead recipient, this does not work:
https://na15.salesforce.com/_ui/core/email/author/EmailAuthor?p3_lkid=<Custom ObjectId>&p2_lkid=<Lead Id>&rtype=00Q

Using the same syntax and a contact recipient, this does work:
https://na15.salesforce.com/_ui/core/email/author/EmailAuthor?p3_lkid=<Custom ObjectId>&p2_lkid=<Contact Id>&rtype=003

Is this a known bug?

 

I know there are a million posts about email URL hacking out there. I've read most of them at this point.

Thanks,
Mike

 

Prafull G.Prafull G.

Hi Mike,

 

The URL hack you are trying to do is not possible. Here are the reasons-

1. The standard Email Author page is rendered based on the record type i.e. Lead OR Contact OR identified by parameter rtype

2. Fields rendered on these pages are different i.e. you must have noticed that the Email Author page for Contact contains Related To field while Page for Lead object does not

3. The parameter you are using i.e. p3 belongs to Related To field and therefore is able to link and working fine on Contact related page however not present on Lead related page therefore throwing standard error.

 

As of now, this is standard behaviour and unfortunately you wont be able to hack this :(

 

Hope it helps. Let me know in case you need more information.

 

Thanks,

Prafull

mikeegarmikeegar

Hi Prafull,

Thanks for the response. This is somewhat of a confusing issue. It is true that the Related To field (set by p3) does not appear in the UI when using the Email Author form for a Lead. However, the p3 parameter does indeed work. Everything works exactly as expected if the p2 parameter is not also used and passed a Lead Id e.g. using:

 

https://na15.salesforce.com/_ui/core/email/author/EmailAuthor?p3_lkid=<Custom_ObjectId>&p2_lkid=<Lead_Id>&rtype=00Q

 

1) Correctly sets the Custom sObject as the related record

2) Merge fields from the Custom Object are populated in templates

3) The 'To' field is correctly set by the rtype parameter i.e. to a Lead Lookup in this case

 

As the p2 parameter is not working/used in this case, you have to manually select the recipient Lead. After doing so:

 

4) An activity is recorded under the Lead as usual when the email is sent

 

Everything other than the URL parameter passing works for Leads. I don't understand why.

 

Thanks,

Mike