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
Lisa Haigy 41Lisa Haigy 41 

Trigger to add a case feed comment if it received from a certain email

I have a trigger on cases that if an external email is received from a certain email, it adds a comment on the case feed.  Is there a way to add a highlight to these comments so it stands out to the user?  Below is my trigger

trigger CaseTrigger on Case (after insert) {
    

   List<caseComment> caseCommentList = new List<caseComment>();
    for (Case t: Trigger.new)
    {
        caseComment cc = new caseComment();
        if(t.ContactEmail == 'abcemail@thisemail.com'){
                cc.parentid = t.ID;
                cc.commentbody = 'For all interactions with Crystal, please ensure that Stephen is also cced on the email';
                cc.ispublished = true;
                casecommentlist.add(cc);
                }
                if(t.ContactEmail.Contains ('@abccompany.gov')){
                cc.parentid = t.ID;
                cc.commentbody = 'For all interactions with abc company, please ensure that all Team Members are copied';
                cc.ispublished = true;
                casecommentlist.add(cc);
                }
                if(t.ContactEmail.Contains ('@abc.edu')){
                cc.parentid = t.ID;
                cc.commentbody = 'For all publishes, please notify abc in advance';
                cc.ispublished = true;
                casecommentlist.add(cc);
                }

        }


            insert caseCommentList;
   
}
AnudeepAnudeep (Salesforce Developers) 
Hi Lisa, 

I was thinking about updating a rich text area field. Unfortunately case comment object is not customizable so we cannot add any custom field

https://success.salesforce.com/ideaView?id=08730000000BpLoAAK

Were you able to acheive this?

Anudeep