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;

Database.update(u, dlo);    // welcome email is still sent

Yes, you can able to stop re-sending welcome email with following steps:

  1. You can uncheck the checkbox in the community(Send Welcome Email to Members), create a custom field in the user like Is_Welcome_Email_Sent__c.

  2. Create a process builder in the user, check user is community user and Is_Welcome_Email_Sent__c is false

  3. Create Email alert action in process builder, Invoke an email alert which will have the vf email template, in vf email template you will able to access {!Community_Url} with {!$Network.NetworkUrlForUserEmails}

  4. Create a time based action, set the time as 0 secs and update the Is_Welcome_Email_Sent__c checkbox in user

| improve this answer | |
  • Yaswant, How will this VF email template know the context of the community? The user may have access to more than 1 community. Which community details does it bring in into the template? – SF Learner Apr 4 '19 at 2:24
  • Also the field {!$Network.NetworkUrlForUserEmails} returned a null value when i used it in the vf email template page. What are the merge fiels that i have to choose from the template? – SF Learner Apr 4 '19 at 2: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.