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

Pass in value to new email subject & body

Added a custom button on the Case Record that opens a new email. How do I get it to populate the email subject and body? This is the link that I added to the button:{!Contact.Id}&rtype=003&p3_lkid={!Case.Id}&retURL=%{!Case.Id}


Alternatively, is there any way to pass in a string variable from the URL that populates the subject & body value?  Not interested in using SFDC's email templates, since they cannot be modified before sending.


Thanks in advance for the help.

Best Answer chosen by Admin (Salesforce Developers) 
Santosh KumbarSantosh Kumbar

Try using this URL :{!Contact.Id}&rtype=003&p3_lkid={!Case.Id}&retURL=%{!Case.Id}






All Answers

Santosh KumbarSantosh Kumbar

Try using this URL :{!Contact.Id}&rtype=003&p3_lkid={!Case.Id}&retURL=%{!Case.Id}






This was selected as the best answer

Custom Button or Link Detail


Will work w SF Template and you can edit:


Name Email_or_Text_Driver

Behavior Execute JavaScript

Display Type Detail Page Button



OnClick JavaScript:



This works for me - Clicking button on Contact record and on custom Objects.

I am able to edit the email when it opens.  

Let me know if this helps or if you have any questions.


I replaced the template_id value with the identifier for one of my html template pages, but I got an error message when clicking the custom button that I created and added to the contact page. This is the error message: 'A problem with the OnClick Javascript for this button or link was encountered: Unexpected Identifier. '


This is the code that I used:


OnClick JavaScript:


Got it to work:






Looks like that was what I recommended.

I am Not sure why I did not get credit for solving the issue.


Please give me some Kudos if you feel I helped you solve the issue.


At any rate I am glade I could help you solve your problem.

Amit SAmit S
An Old post, but checking if anyone has resolved the requirements to customize the Send Email Page.

Need to add Custom fields from Tasks Objects onto the Email Page once clicked on the Send Email Button.

Has anyone customized the Send email page? Is a VF Page and Custom controller the only option? Appreciate any help or Link to a similar peice of customization on this.

I have tried using window.location = '/_ui/core/email/author/EmailAuthor?p2_lkid=' + cont_result[0].Id + '&rtype=003&p3_lkid={!Account.Id}&retURL=%2F{!Account.Id}&template_id=00XN0000000QfDy'; but this allows only the Body of the email to be customized.

Where as I want Two Custom fields to be shown and allowed to pick values from the Email Page before sending.