You need to sign in to do that
Don't have an account?
Anu Maniappan
How to stop the default email notifications for a particular User in salesforce through apex code
Hi All,
I am trying to stop the default email notifications for a particular User in salesforce through apex code.
Stopping default email notifications can be done manually by going to My Settings -> Email Settings and unchecking 'Receive emails' checkbox.
I need to achieve the same thing through Apex code. Please suggest how can this be done?
Thanks,
Anu
I am trying to stop the default email notifications for a particular User in salesforce through apex code.
Stopping default email notifications can be done manually by going to My Settings -> Email Settings and unchecking 'Receive emails' checkbox.
I need to achieve the same thing through Apex code. Please suggest how can this be done?
Thanks,
Anu
NetworkMember mem = [SELECT Id, PreferencesDisableAllFeedsEmail FROM NetworkMember WHERE MemberId = ''.....UserId...'];
mem.PreferencesDisableAllFeedsEmail = true;
update mem;
All Answers
UserPreferencesDisableAllFeedsEmail, check whether it will help
Looks like 'ReceivesInfoEmails'. You can try this from user object. Not sure just for your reference.
NetworkMember mem = [SELECT Id, PreferencesDisableAllFeedsEmail FROM NetworkMember WHERE MemberId = ''.....UserId...'];
mem.PreferencesDisableAllFeedsEmail = true;
update mem;