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
RejonesRejones 

Apex Trigger for Email Alert

I need an apex trigger that will send an email alert to both the Lead owner and the Lead Owners Manager when a lead has not been read for 2 days after the created date. 

 

Can anyone help me write the trigger and the Test Class for the trigger. 

Best Answer chosen by Admin (Salesforce Developers) 
neophyteneophyte

I believe this requirement should be implemented using a time based workflow on trigger and an associated email alert.

 

Anand

All Answers

neophyteneophyte

I believe this requirement should be implemented using a time based workflow on trigger and an associated email alert.

 

Anand

This was selected as the best answer
RejonesRejones

I have a workflow with a timebased Trigger and and email alret however it does not give me the option to also email the lead owners manager.  


SFFSFF

Create another email alert and associated it with the same workflow - you can have multiple actions driven from the same workflow criteria.

 

In a pinch, you can always also create another workflow.

 

Good luck!

RejonesRejones

We tried that as well the problem is there is not an option in the Email Alert Edit page to select the Manger.  So we have to create a field for the manager and we need a trigger to update that field from the users information page.