+1 vote
by (163k points)

Deliverability for the org is All Email

Enable User Control over Task Assignment Notifications is enabled for the org

I've confirmed that users have Email me when a task is assigned to me selected for their user record...

Yet this snippet of code creates a task and DOES NOT send an email to the assigned user... Is there any other setting I'* missing for this to work?

Database.DMLOptions dmlOptions = new Database.DMLOptions(); 
dmlOptions.EmailHeader.TriggerUserEmail= true;
Database.SaveResult sr = Database.Insert(taskRecord, dmlOptions);

Also, I confirmed that there are no errors (i.e. sr.isSuccess() is true)

1 Answer

+1 vote
by (163k points)
Best answer
Welcome to Memory Exceeded, where you can ask questions and receive answers from other members of the community.