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

Case owner notification for new case comments

I am using email services to process email-to-case. My code correctly creates the case and updates the case when a reply is received. However, even though I am using the DML options to trigger user email, the case owner does not receive a notification when a reply is received. Cases/emails sent through the email-to-case service notify correctly.




Are you doing this through trigger is yes then where did you code the trigger.

Ideally you have to place the trigger on the "Case Comment" object and from there you should be tiggering the emails to the user in case you have implemented it via triggers.


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


The code is an Apex class and is referenced by an email service.


Hi, Did you ever figure this out? I'm running into the same issue. I'd rather not have an extra trigger for case comments, and it's preferred that I can use the standard case comment workflow to notify the owner.





Not sure if you figured it out but this did it for me....I had to manually set the flag that enables a comment creation to trigger email notifications.


you can do it a couple ways - by setting the options on the actual object being inserted. or passing the options along with the 'insert' command. Matter of taste.


Lead l = new Lead();
...fill in details...
database.DMLOptions dmo = new database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = true;
dmo.EmailHeader.triggerUserEmail = true;
insert l;
CaseComment c = new CaseComment();
c.ParentId = caseNo;
Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerUserEmail = true;
database.insert( c, dlo);

 link to the explanation of the DMLoptions you can/need to manage manually.


I always forget the fact that triggers of notificaitons are tied into the GUI (and you have to manage them manually in code). And there are other flags too - like "triggerassignmentrule, etc"

If "Case Owner" and "Case Comment" creator are different then only Case Owner will get notification else Case Owner will not get notification.