Community users are not receiving their welcome email when testing a custom self registration form in a sandbox org.
Current setup
- The custom community user login profile has been configured in the
workspace > administration > members
section - The
Welcome New Member
email template is configured - The
Send Welcome email
checkbox is selected - The email template is
Available For Use
- The community is
Active
- System email deliverability is
All email
When we use the custom self registration form, it successfully creates the Person Account
and User
records, but no welcome email is sent.
The custom self registration form uses the below code to create the account and user:
public without sharing class SignupService
public Boolean createAccount(SignupParams params) {
// creates the SObject, but does not insert
User user = createUser(params);
// creates the SObject, but does not insert
Account person = createAcccount(params);
insert person;
String userId = Site.createExternalUser(user, person.Id, params.password);
return true;
}
}
Questions
- Why is the email not being sent?
- How do I fix it?
Best Answer
createExternalUser
and it seems the default is set to false to not send.true
: