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
stevenyanstevenyan 

Triggering on an email being sent to a Contact

I've set up a Send an Email button on my Account layout that will open the Send An Email screen and autopopulate the Primary Contact associated with the Account and a template based on some of the data in the Account record.

I would like to now set a date field on my Account record that marks the Email as having been sent after I click "Send" in the Send An Email screen.  Is there a way to accomplish this using Apex triggers?  I imagine if there's a way to trigger on an email being sent, it would simply be a matter of pulling the Account associated with the email and setting the appropriate Date field.  Any help would be greatly appreciated.

 

Best,
Steven

MpalaiMpalai

Hello

 

create a new field for email sent date on account.

on button action update that field with current date.

 

regards

mpalai

stevenyanstevenyan
This isn't an ideal solution because it's possible that someone can click the Send Email button to compose the email, but not actually send it.  Ideally this triggers on the email actually being sent.