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
PRepakaPRepaka 

How to read the email subject and body from the visual force email templates after sending an email

hi

 

I am sending email using visual force email templates with merge fields. i want to read the email subject and body after sending the email. how can i do this.

 

please help me

Venkat PolisettVenkat Polisett

 

select ( select subject, description from activityHistories

      where subject like 'Email:%' 

order by createddate desc limit 10 ) from account LIMIT 1

 

 

The above query will give you the last 10 activity history emails. Change the where clause to your liking.