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

Send Notification Email when created a case

I have an apex trigger that creates a new case and assigns it to a specific user.  What code would I use to tell Salesforce to send a notification email to the user?  In the Salesforce UI you can simply check off the "Send Notification Email" check box when assigning the case.
I don't think there is an api call to do this directly, at least, I couldn't find one.
I can think of 2 ways you could do this.
1) create a workflow action to send the email alert when the case is created.
2) use apex outbound email to create and send the email.  Careful with this option though, because depending on how many cases you are creating ,there are some limits to how many outbounds you can send this way.
Yup that is what I was trying to aviod, but if it's the only way....