1

I need some help regarding Chatter email settings.

I am creating a custom Chatter application and need to configure email permissions from a custom page.

As per this page https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_user.htm, we can control them by setting various user fields.

However these settings are not overriding "My chatter settings" accessible from Personal Setup. Hence I am not able to turn off the email notifications.

I managed to find a Connect API method for Group Email settings :https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_ConnectAPI_ChatterGroups_static_methods.htm#apex_ConnectAPI_ChatterGroups_getMyChatterSettings

Does anybody have any idea about this?

  • Have you tried updating UserPreferencesDisableAllFeedsEmail to true on user object? This effectively disables email. help.salesforce.com/… – Sagar Pareek Dec 30 '15 at 8:54
  • We want to provide users a way to control their email settings via custom interface. – Salesforcesmarty Jan 1 '16 at 3:34
1

Ahh it was tricky. Looks like salesforce maintains two set of these configurations at two different places

  1. User Object
  2. NetworkMember object

and Network Member supersedes the user configurations. Below is the query to get these details

chatterSettings = [select id, PreferencesDisableLaterCommentEmail,PreferencesDisableLikeEmail,PreferencesDisCommentAfterLikeEmail
                     FROM NetworkMember 
                    WHERE memberID=:userinfo.getUserId()
                    Limit 1];

After toggling these settings, chatter stopped sending emails to community users.

| improve this answer | |
  • I logged out yesterday. Yes you got it right! – Sagar Pareek Jan 2 '16 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.