We have a customer community with the "Send welcome email" box checked within the configuration, as we want the users to receive a link to set their password after they are created. For one reason or another we may need to deactivate these users temporarily. However upon reactivating these users, the welcome email is sent out again and the user is asked to set their password.
Deactivating and reactivating normal users does not reset their password or send an email if the "Generate new password and notify user immediately" box is unchecked (or if the activation is done through code). We would like the reactivated community members to be able to continue logging in with their old password and not receive a duplicate welcome email.
Is there any way to suppress subsequent welcome emails after the user is initially created?
Thought I might be on to something by specifying
DMLOptions.EmailHeader.triggerUserEmail, but this did not suppress the email as I expected.
User u = getCommunityUser(userId); u.IsActive = true; Database.DMLOptions dlo = new Database.DMLOptions(); dlo.EmailHeader.triggerUserEmail = false; u.setOptions(dlo); Database.update(u, dlo); // welcome email is still sent