My requirement is to send the email with customized body when the user clicks on a button in the detail page layout.

I have a custom button in the detail page layout. When user clicks on the button, a VF page is displayed with the email body content. In this VF page, I have two buttons. One for editing the email body and one to send the email to the users. When the user clicks on send email button, the email is sent from VF page.

Is there any way to log this email sent in the Activity History table?

As of now, I have an idea to create a note as a history with the details like from address, toaddress,ccaddress and bccaddress.

Thanks in advance.

1 Answer 1


From the docs:

setSaveAsActivity: Optional. The default value is true, meaning the email is saved as an activity. This argument only applies if the recipient list is based on targetObjectId or targetObjectIds. If HTML email tracking is enabled for the organization, you will be able to track open rates.

If you want to do anything fancier, you have to roll your own solution.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .