+ Start a Discussion
Mani PenumarthiMani Penumarthi 

Customizing the "Send Email" button on email realated list of case.

Hi Guys,

Can any one tell me how to customize the "Send Email" button on email related list of case. Basically I need to change the  "To Address" on email layout before sending an email. I have written a trigger on the Email Message but the email functionality was executing before invoking trigger. 

The to address of the email should be the mailing address which will be extraced from the case record.

Can any one suggest me how to achive this functionality.
SonamSonam (Salesforce Developers) 
You would need to create a custom Send email button and then create a visualforce page to replicate the send email page on VF:

Sample codes on the link below:
Mani PenumarthiMani Penumarthi
Hi Sonam,

I think there is no way to create a custom button on EmailMessage Object. Could you suggest me the possible way to create a custom button on EmailMessage Object.
SonamSonam (Salesforce Developers) 

What you can do is : create a custom button on Task object and make it a URL such that it can open a visualforce page> on the visualforce page write the code to send email and get back to the case detail page once email is sent.

How will you add this button to the case detail page:
Open the case page layout> go to thr Activity History related list> click on the settings button and add the button to the layout of the related list.

Once done, you should be able to see the button on the Activity related list of the case object detail page.

Hope this helps!