[SalesForce] Disabling email notifications for Community user in salesforce

I'm trying to stop the email notifications to a community User through APEX code for the following scenarios:

  1. Welcome email for a New User creation
  2. Email notification on receiving a Private message.

I have used the following code to disable the Email notification:

userId.UserPreferencesDisableAllFeedsEmail = true;

Even then the emails are thrown to the user.
Please suggest some workaround for this.

Best Answer

did you tried "email --> Welcome New Member" check box option available on configuration page ? From there you can disable welcome email. There is any specific use case to do this using Apex code ?

Related Topic