function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NLTNLT 

How to stop users from receiving emails at user level in salesforce?

Can anyone help how to stop users from receiving emails by doing changes at user level in salesforce?
MagulanDuraipandianMagulanDuraipandian
We don't have any option OOTB.
What kind of email alerts you want to avoid?

You can disable the below at user level.
  • Salesforce CRM Content User    
  • Receive Salesforce CRM Content Email Alerts    
  • Receive Salesforce CRM Content Alerts as Daily Digest
--
Magulan Duraipandian
www.infallibletechie.com
NLTNLT
Hi Magulan D,

I have tried disabling above checkbox at user level but still user is receiving emails, Could you please help me with alternative solution for it.

Thanks,
Ajay K DubediAjay K Dubedi
Hi,

Yeah you can disable a user from receving email try using the following code:

NetworkMember mem = [SELECT Id, PreferencesDisableAllFeedsEmail FROM NetworkMember WHERE MemberId = ''.....UserId...'];
mem.PreferencesDisableAllFeedsEmail = true;
update mem;

This should do the job for you.
      
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi