You are here:
Emails in the Site Case Feed
When you enable the site case feed for Aura and Salesforce Tabs + Visualforce, external users with access to a case see case emails in their feed. Emails in the site case feed include the email’s author, recipients, text, and time sent.
By default, if the case contact sends or receives a case email, that email appears in the feed of all users—both internal and external—with access to the case. For an external user to view the case, their profile must include access to cases in the site.
For example, suppose Rita, an external user, posts a question. The question remains unresolved, and a moderator creates a case from it using the Question-to-Case action. If the support agent assigned to the case emails Rita from the email publisher, Rita and all other users with access to the case see the email in their case feed. Users with access to a case typically include the assigned support agent and the case contact.
Using Apex to Show or Hide Emails in the Case Feed
The
IsExternallyVisible field of the EmailMessage object controls the
visibility of email messages in the site case feed. When the field is set to
true, emails sent or received by the case contact are visible to external
users with access to the case.
If the site case feed is enabled, you can write an Apex trigger or process to hide or expose all case emails in the feeds of external site users. First, create an Apex class with a Future method to update the IsExternallyVisible field. Then, create a trigger on EmailMessage and pass the EmailMessage objects into the method on insert/update in the After context.
