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
debikendebiken 

Send email containing lead info to contact

Hi all,
Been struggling with this a few days now.  I have a simple task, a lead comes in, and I need to notify the lead owner (who is a salesforce user) and allow them to forward the information to a contact at an account (our distribution network).   I have a lookup field to Account on the lead object.  I have a custom template with fields that merge from the lead object.  I need to be able to send the email "To" an account contact, but merge in the fields from the lead object.  I either end up with the lead fields merged in and the "To" going to the lead's email, or the "To" lookup displaying contacts, which is what we need, but then the merge fields not working.  

I have tried every combination of p2_lkid and p3_lkid and rtype set to 003 or 00Q, all to no avail, or an error message about the parameter length.  

/_ui/core/email/author/EmailAuthor?retURL={!Lead.Id}&rtype=003&p2_lkid={!Lead.Dealer__c}&template_id=00X38000001fie4&p24=
{!Lead.OwnerEmail}   *** "To" button search points to contacts, merge fields are being populated with Contact info rather than lead

/_ui/core/email/author/EmailAuthor?retURL={!Lead.Id}&rtype=00Q&p2_lkid={!Lead.Dealer__c}&template_id=00X38000001fie4&p24=
{!Lead.OwnerEmail}  *** I change rtype to 00Q (lead) then the fields merge correctly, but the "To" lookup field displays leads, not contacts

I would be EXTREMELY GRATEFUL to anyone who has done this successfully with a simple button using the EmailAuthor function.  
Thanks in advance!!!
Best Answer chosen by debiken
Parker EdelmannParker Edelmann
You can have a field on a screen that requires the user to enter the contact's name and other information and send it to a lookup element and assign the proper fields to variables. Using the Contact's & Lead's fields and assigning them to variables will take the place of the merge fields in the template. You can set certain fields to variables before the flow does anything else if you're doing this from a custom button on a lead record. I have not done what you're trying to do, but I have done enough to know that if variables are assigned properly, this can be done. I don't think that if the variables are assigned properly, that there should be any mix-up with Contacts and Leads. I hope this helps.

Thanks,
Parker

All Answers

Parker EdelmannParker Edelmann
Have you tried Visual Workflow? I believe it can do exactly what you're asking.
debikendebiken
Thanks Parker, I tried going down that path but there's not an easy way to do this with merge fields.  I can build the flow, create the variables I need but the user needs to be able to select the contact from a lookup and then merge the lead data into an email template.  Have you done something similar?
Parker EdelmannParker Edelmann
You can have a field on a screen that requires the user to enter the contact's name and other information and send it to a lookup element and assign the proper fields to variables. Using the Contact's & Lead's fields and assigning them to variables will take the place of the merge fields in the template. You can set certain fields to variables before the flow does anything else if you're doing this from a custom button on a lead record. I have not done what you're trying to do, but I have done enough to know that if variables are assigned properly, this can be done. I don't think that if the variables are assigned properly, that there should be any mix-up with Contacts and Leads. I hope this helps.

Thanks,
Parker
This was selected as the best answer
debikendebiken
I have been working with variable assignment today and it looks like this is going to work for me.  Have a few issues to work out but I think they are minor!  Thanks so much for you pointing me in the Visual Workflow direction, it's a powerful tool!