In Salesforce Chatter is a great way to boost collaboration in your organization. The user can Post Status, Links, Files, and comments on others post. We can also add any number of users in Chatter group. Chatter can email you every time someone follows you, posts to your profile or groups, etc. You can also receive daily or weekly Chatter group email digests for the group you are a member of as well as a Personal digest (It contains posts from your feed and up to 3 comments per post). To receive Chatter email notification and digests System administrator has to enable email notifications for your organization. By default Personal digest is set to Daily and New Chatter groups I join Digest is set to None for new users.
Business Use case
Tamara McCleary is working as a System administrator at Universal Containers (UC). She has received a requirement to auto update new user’s Chatter email settings as mentioned below
- Frequency for personal digest: – Weekly
- Default frequency for groups I join: Email on each post
Solution for the above business requirement
There are multiple solutions possible for the above business scenario. You can either use Apex trigger, a combination of Flow and Process Builder, and few more. We will use Process Builder to solve the above business requirement. Before proceeding you have to understand User objects in Salesforce.
A) DefaultGroupNotificationFrequency: – This field represents the default frequency for sending the user’s Chatter group email notifications when the user joins groups.
B) DigestFrequency: – This field represents the frequency at which the system sends the user’s Chatter personal email digest.
Possible options for Notification Frequency are
–> Daily Digests
–> Weekly Digests
–> Email On each post
Follow the below instructions to create a Process for the above business requirement
1. Click on Name | Setup | App Setup | Create | Workflows & Approvals | Process Builder
2. To create a new process from scratch, click on the New Button available on Process Management page, A popup will open where you have to enter Name (Enter Update Chatter Email Notification as name), API Name and Description as shown in the below screenshot
3. Once you click on the Save button, it will redirect you to Process canvas. Click on Object node to add object, select User object, in this case, and set the evaluation criteria, Please refer to the following screenshot for more details
4. The next step is to define Process criteria. For this click on Add Criteria node, Enter Criteria Name, Set filter conditions (Similar to Rule Criteria in WFR), as shown in the following screenshot
5. Now we have to add an Immediate action into the Process to update the user record. For this use Update Records action, Use Field Picker to select the field Description and Text Entry field to enter a comment or sentence. Click on the User object as shown in the following screenshot to select the object
Then select the fields Default Notification Frequency when Joining Groups and Chatter Email Highlights Frequency fields, Choose the frequency as shown in the following screenshot
6. Finally, the Process will look like the following screenshot, clicking on the Activate button.
It’s time to test this Process
Now onwards if the system administrator creates a new user, Process builder will automatically update their Chatter email notification frequency, as shown in the following screenshot
Likewise, you can update other preferences for Chatter email notification for new or existing users.