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

Trigger on emails being sent

Whenever an opportunity's closed won, we have several workflows in place that send out emails using a template. 


My question: can I make a trigger (or workflow) on emails sent out that creates an activity with the email's conent in the subject/comments? 


I'm sorry to say that you can't fire a trigger from an email being sent. I needed this functionality too and SFDC support confirmed it is not possible. However, when sending emails from APEX code, and activity will be logged to the target object by default. If that doesn't suffice, you could create the activity yourself. Long story short: convert your workflows to triggers.




If you want to sent email also create activity of that email .for this functionality you have to write a trigger on the opportunity. 


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.