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
itsderek2332itsderek2332 

email2case: How are replies appended to a case (email task, case comment, etc.)?

I'm looking at using email2case. I'm curios as to how replies to a case are appended. Do they become case comments, an email activity, or something else?

Cheers,

Derek
werewolfwerewolf
Not sure how I missed this thread, but replies are appended to a case in the Email Message list on the case, not as case comments.  They also appear as closed tasks.
insanedukeposseinsanedukeposse
Has anybody tinkered around with this and tried to automatically copy the contents of the email into a new comments record? We have found that most of our support users do this manually, so we're evaluating automating the process. It does not look like a workflow rule will work. Perhaps with an Apex trigger...
werewolfwerewolf

A workflow rule + an apex trigger would work. 

 

- Make a custom field on Case called "last email."  Don't show it on any page layout.

- Make a workflow rule on Email Message which copies the text of the email to that field.

- Make an Apex trigger on Case which takes that field and makes a new comment out of it.

MurphyMurphy

Does the comment get assigned to the portal user or the .org admin?

 

Do you have sample code you can share?

 

Thank you.

werewolfwerewolf
Actually when I wrote that it was a 3-step process, but now it's a one-step process -- you can just write a trigger directly on EmailMessage to create the comment.  The comment creator will be the email creator, so it'll be the Email To Case user.  No, I do not have any sample code.