I'm trying to stop the email notifications to a community User through APEX code for the following scenarios:
- Welcome email for a New User creation
- 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.