You need to sign in to do that
Don't have an account?

Quick-Email button: using it within an Opportunity
Relating to the article titled The Quick Email Button in the Service & Support Blog of Successforce, I had the following query:
I'm trying to co-opt what did for a Case to create a link for an Opportunity. I'm calling it "quick close email" which, as planned, will allow a rep to pull up our closing email template with one click from the Opportunity page. The syntax I am using follows:
Where "your template here" is the 15-character ID for the email template I would like to use.
Unfortunately, there's something wrong with the command -- it returns an "Unable to Access Page" message when launched from the opportunity. Doubly unfortunately, I know nothing about javascripts, so I can't troubleshoot this on my own. Any clues for me? Thx!
I'm trying to co-opt what did for a Case to create a link for an Opportunity. I'm calling it "quick close email" which, as planned, will allow a rep to pull up our closing email template with one click from the Opportunity page. The syntax I am using follows:
Code:
location.replace('/email/author/emailauthor.jsp—retURL=/{!Opportunity.Id}&p3_lkid={!Opportunity.Id}&rtype=003&p2_lkid={!ContactId}&template_id=<your template here>');
Unfortunately, there's something wrong with the command -- it returns an "Unable to Access Page" message when launched from the opportunity. Doubly unfortunately, I know nothing about javascripts, so I can't troubleshoot this on my own. Any clues for me? Thx!
Your merge field is wrong, for one. Opportunity has no {!ContactId}, nor does it have the properly formatted version, {!Contact.Id} -- opportunity has a
separate Contact Roles table. If you have made a custom field that is a lookup to Contact then you could use that, but by default opportunity has no
direct Contact field.
Did you in fact put a template ID in the <your template ID here> or are you actually using that verbatim? If your URL really says <your template ID here>
then that won't work, you have to put a real template ID there per the instructions on the blog.
Thanks, Werewolf.
I'm trying to use also the Quick Email Button.
I have implemented it and it works just fine,
the only thing I would like to modify is the "To" recipient and I can't seem to find how to do it.
Do you have any clue?
Thank you in advance for your help,
Cédric
Would you be so kind as to copy the text of your javascript into the discussion here? I don't understand the syntax well enough to make it work, as easy as it should be. It sounds like your attempt worked... I'm a newbie, and would appreciate the help. Thanks!
I'm trying to do the same thing within a Lead... here is my javascript:
location.replace('/email/author/emailauthor.jsp?retURL=/{!Lead.Id}&p3_lkid={!Lead.Id}&rtype=003&p2_lkid={!Lead.ContactId}&template_id=<00X40000000xczW>&p5=');
Since Leads don't have a contact ID, I'm not sure what should go there instead... Can you help me please?
Christy
location.replace('/email/author/emailauthor.jsp?retURL=/{!Lead.Id}&rtype=00Q&p2_lkid={!Lead.Id}&template_id=<00X40000000xczW>&p5=');
It still isn't working... =(
I'm trying do to the same thing, but as a Detail Page Link instead, but it isn't working... can you help again, please?
location.replace('/email/author/emailauthor.jsp?retURL=/{!Contact.Id}&rtype=00Q&p2_lkid={!Contact.Id}&template_id=00X40000000xd0Y&p5=');
Christy
http://www.salesforce.com/us/developer/docs/ajax/Content/sforce_api_ajax_more_samples.htm?Highlight=sendEmail
Hi all,
Thanks for all the contributions to this thread - in leiu of a user's guide on url parameters it is a great help!
I am trying to do basically the same thing as everyone else here, with one caveat I can't compensate for.
I want to send the email to an address that is stored in a custom field on a record (I know, it should be a contact lookup but it's not for a very good reason which I won't get into here.)
So I have set up my url as follows:
/email/author/EmailAuthor?p2_lkid={!Marketing_Request__c.RequestorEmail}&rtype=003&retURL=%{!Marketing_Request__c.Id}&templateId=00X4000000125P3
Message Edited by Ems on 09-09-2008 02:18 PM
Posting parameters to EmailAuthor is not supported by Salesforce, so no, there is no documentation on the parameters it will accept. You'll have to deduce this by inspecting the page and pages that call it using tools like Web Developer for Firefox that show the form field names. Some have posted their findings here and and on blogs. Try Googling EmailAuthor.
On a closely related topic, I found that Visualforce email templates with visualforce attachments require an additional parameter:
new_template=1
So a full custom link might look like:
/_ui/core/email/author/EmailAuthor?p3_lkid={!Opportunity.Id}&template_id=00X700000015lI1&cancelURL=/{!Opportunity.Id}&retURL=/{!Opportunity.Id}&new_template=1
Without "new_template" the email template will appear, but not the visualforce attachments.
Hope that helps someone out there.
Good luck with that. You're going to have a very hard time getting it to resolve an email template and make it editable before you send it out.
To your question, no, you'll have to write your own buttons (although while you're at it maybe you can make the attachment button inherit attachments from the parent object, which it currently doesn't do).
Hi all-
I found http://blogs.salesforce.com/support/2008/07/the-quick-email.html very helpful, but now am trying to take it a little further... I have the below for sending an email from a Lead record...
location.replace('/_ui/core/email/author/EmailAuthor?retURL=/{!Lead.Id}&rtype=00Q&template_id=00XS0000000QLzT&p2_lkid={!Lead.Id}&p5=')
This works great, but I don't want the 'To' entry to populate. The problem is that if I remove 'p2_lkd={!Lead.Id}', then the Lead merge fields in my email template do not populate. Is there a way the merge fields can pull from the Lead record, but not poplulate the 'To'. Ultimately I would like a button to email the Lead information to someone else.
Thanks in advance...
FYI- Chirag post here is also helpful if have not seen - http://community.salesforce.com/sforce/board/message?board.id=scontrols&message.id=1063
hello, I finally found the solution! :robothappy:
you have to add the parameter "p3_lkid= {!Lead.Id}"
this is my button:
location.replace('/email/author/emailauthor.jsp?p3_lkid={!Case_Study__c.Id}&retURL
=/{!Case_Study__c.Id}&rtype=00Q&template_id=00X20000001L1H7&new_template=true'
Thank you, Fra08! Copying that code solved my Lead email template/custom button woes.
is there any way to dynamically select the template using a few nested IF statements?
Hi,
I hope this thread is not dead. I just created a Quick Email button using Werewolf's code. I want the email to go to the record/case creator (Created By). Based on the code I have, it goes to the case owner. Can someone help me identify what needs to change in the code below. Admittedly not a Java Girl. Other than this, the button works perfectly...just going to the wrong person. Here is my button:
location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=00X40000001T2B0&p5=&save=1')
Thanks.