|
|
|
|
|
Force.com Discussion Boards :
Developer Boards :
General Development :
Default Template and Email From Address
|
|
|
|
|
|
|

|
Re: Default Template and Email From Address
[ Edited ]
|
|
werewolf
Super Contributor
Posts: 3273

Message 2 of 22

Viewed 33,917 times
|

|
Watch the Service & Support blog on Successforce for an in-depth treatment of customizing the Email page -- it'll probably be posted next week. Here's a relevant excerpt:
So let's say you have a template that you usually use for Cases
which contains some pleasantries and then a merge field that adds in
the text of any related Solutions. If you've not used Email Templates
much before, by the way, have a look at the sample template entitled
"SUPPORT: Case Response with Solution (SAMPLE)" -- it does just what
I've described here.
Anyway, what you'll want to do is make a custom button that preselects this template. It's quite simple really.
The first thing you'll need to do is get the ID of the template you
want to use. This can be found by finding the template via
Setup->Communication Templates->Email Templates. Click on it and
look in the URL -- you'll see an ID up there that looks like
00X30000000rNM0 (which may be followed by a ? with some other
parameters -- ignore that stuff, just take the 15-character ID that
starts with 00X). Copy that ID into Notepad or someplace where you can
get to it later.
Now go to Case and create a Custom Button -- let's call it Email
Solution. Set its Behavior to Execute Javascript and its Display Type
to Detail Page Button.
In the Javascript area add this line of code, replacing the <your
template here> with the ID of the template you saved earlier: location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=<your
template
here>');
Message Edited by werewolf on 07-11-2008 09:42 AM
|
|
|
|
07-11-2008 09:41 AM
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
Re: Default Template and Email From Address
|
|
Austin JRB
Regular Contributor
Posts: 10

Message 7 of 22

Viewed 33,637 times
|

|
|
This works very well except I have a situation where we are using "Person Accounts" . How do I get the email address from a Person Account into the 'TO' field on the Case?
Thanks,
JRB
JRB
|
|
|
|
07-23-2008 07:00 AM
|
|
|
|
|
|
|
|

|
Re: Default Template and Email From Address
[ Edited ]
|
|
finalist
Regular Contributor
Posts: 92

Message 9 of 22

Viewed 30,491 times
|

|
|
I am trying to do the very same thing, but from an Opportunity rather than a Case. I have it working for a specific Opportunity, but of course I want to make sure that it works across the board for all Opportunities. What I'd like to know is what the particular IDs refer to.
Code: finishedLocation = ('/email/author/emailauthor.jsp—retURL=
/{!Opportunity.Id}&p3_lkid={!Opportunity.Id}
&rtype=003&p2_lkid=0017000000SC8BY
&template_id=00X70000000tw5Q');
Here I am hard-coding the value for p2_lkid; in your example above it is the Contact ID or the Account ID (for a Person account), but there isn't a corresponding ID necessarily for an Opportunity. I'd leave it out if possible, and force the user to make a selection, but leaving it blank isn't a valid choice. That particular ID is what I gathered from the address when I selected Activities/Send Email from the Opportunity; the Opp IDs I was able to locate, but I don't know where the ID ending SC8BY (line 3) came from, so I don't know what to substitute there -- I thought it might be my user id, but no ...
Can the p2_lkid be bypassed?
Message Edited by finalist on 08-26-2008 06:39 PM
|
|
|
|
08-26-2008 06:25 PM
|
|
|
|
|
|
|
|
|
|
|
|