Root Cause:
Salesforce controls visibility of EmailMessage records for external (Community) users through the IsExternallyVisible flag.
You need to set the IsExternallyVisible flag to true on the relevant EmailMessage records to make them accessible in the community feed.
This can be done either via Anonymous Apex execution in the Developer Console or by writing an Apex Trigger to set it automatically.
-----------------------------------------------------------------------------------------
Option 1: Fix via Anonymous Apex for existing records
Use this if you want to manually make existing emails visible.
List<EmailMessage> lstEmt = [
SELECT Id, IsExternallyVisible
FROM EmailMessage
WHERE RelatedToId = 'RECORD_ID_HERE'
];
for (EmailMessage emt : lstEmt) {
emt.IsExternallyVisible = true;
}
update lstEmt;
Replace 'RECORD_ID_HERE' with the actual Contact or Object record ID.
------------------------------------------------------------------------------------
Option 2: Write a trigger using the above code snippet
004867920

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.