|Available in: Enterprise, Performance, Unlimited, and Developer Editions|
Suppose Rita, an external user, posts a question in a community. The question remains unresolved, and a community 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 will see the email in their case feed. Users with access include the assigned support agent, case contact, and any partners.
You can write an Apex trigger to set the visibility of case emails to external users who have access to the case, regardless of whether you’ve enabled the community case feed. The IsExternallyVisible field of the EmailMessage object controls the visibility of email messages. When the field is set to true—its default value—email messages are visible to external users. To hide case emails from external users, write a trigger that sets the IsExternallyVisible field to false when an email message is created.