I am creating User in salesforce with profile of system administrator. while doing this, I am getting email of login to salesforce as default email from support@salesforce.com

but I am also getting Welcome email of my community portal as well which is not required

so can anyone tell me how to stop this welcome email while creating system administrator from salesforce?


but I am also getting Welcome email of my community portal as well which is not required

This is most likely because the profile on which you are setting up the User is also a member of the Community.

In order to stop email triggered from Community in this case, you have two options:

  1. Stop Welcome Email from Community --> Administration --> Emails
  2. Remove the profile from Community (this option though also removes access from Community for all Users on that profile)
| improve this answer | |

Another way would be to temporarily disable all emails sent from SF for the duration of time when you are adding Members /Profile to the communities. You can do that using

Setup -> Email Administration -> Deliverability -> Access Level set to None

Also if you are creating Users via Apex you can set a triggerUserEmail as False

User u2 = new User(contactId=con.Id,
                    communityNickname = con.LastName + '_',
                    alias = string.valueof(con.FirstName.substring(0,1) + con.LastName.substring(0,1)),
                    profileid = PROFILE_ID_FOR_COMMUNITY_USER,
Database.DMLOptions dlo = new Database.DMLOptions();
**dlo.EmailHeader.triggerUserEmail= false;**
Database.saveresult sr = Database.insert(u2,dlo);

Src: https://developer.salesforce.com/forums/?id=906F00000005KJrIAM

| improve this answer | |
  • 1
    I would also add a caveat here that using this option impacts ALL emails being sent out from the Org. – Jayant Das Oct 31 '18 at 14:51
  • @JayantDas I second that :) , this should be kept in mind while using this. Setting up users is one time or little time-consuming activity if one is cautious enough it can be a good strategy. – Pranay Jaiswal Oct 31 '18 at 14:53
  • 1
    But using NONE also restricts the internal new user email notification as well. – Jayant Das Oct 31 '18 at 14:56
  • @JayantDas I missed that.. silly me :/ – Pranay Jaiswal Oct 31 '18 at 14:58

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.