+ Start a Discussion
MinouMinou 

Email button on a custom object

I have been attempting to use  The Quick Email Button to help me create a button in a custom object that will generate an email.  I have successfully created the email button and the email template, but when I click the email button none of my merge fields are populating in the email.  What am I doing wrong?

 

Here is the code I have set up:

location.replace('/email/author/emailauthor.jsp?retURL=/{!Candidate_Tracker__c.Id}&template_id=00X50000001Ri74&p5=');

 

Thank you!

MinouMinou

This is the information that I am attempting to populate in the email :

 

{!Candidate_Tracker__c.Manager__c}, 
  
ABC Company wishes to submit {!Candidate_Tracker__c.Candidate__c} for the {!Opportunity.Position_Title__c} position.
 
Respectfully,
{!Candidate_Tracker__c.Sales_Person__c}

 

Part of my issue is understanding the different email parameters that are involved in writing this code, for example what is this parameter defining: &p2_lkid= and this one as well: &p3_lkid=

 

Is there an online resource that can explain to me what these different items are? I have been researching this all day and have exhausted all efforts of finding anything on this topic.

MinouMinou

I was finally able to find the information I needed for this....

 

Thanks!

Ken Erb.ax744Ken Erb.ax744

In your post you said you found what you were looking for with respect to sending an email from a custom object. Can you please let me know where you found it.

 

Ken

MinouMinou

Absolutely Ken!

 

Here is the post I found that was most helpful.....Sending template emails in an scontrol. The code in this particular post is for an s-control but I used Javascript behind my button. To do this you will need to set up your button in the following manner:

 

Display Type = Detail Page Button

Behavior = Execute JavaScript

Content Source = OnClick JavaScript

 

Here is the code I used and it works like a charm!

location.replace('/email/author/emailauthor.jsp?retURL=/{!Candidate_Tracker__c.Id}&p3_lkid={!Candidate_Tracker__c.Id}&p2_lkid={!Candidate_Tracker__c.Manager_NameId__c}&p6= Resume&template_id=00X50000001RiCn&p5=');

 

the wording listed after the &p6= will be the text displayed in the subject line of the email.

 

Hope this helps you!  Good Luck!