Getting Started with Process Builder – Part 23 (Send a Welcome Email with Attachments to New Users)

Getting Started with Process Builder – Part 23 (Send a Welcome Email with Attachments to New Users)

Last Updated on November 23, 2020 by Rakesh Gupta

Big Idea or Enduring Question:

How do you automatically send a welcome email to new users with onboarding documents? 

Objectives:

This blog post will help us to understand the following

  • How to use the Process Builder to send out an email alert with attachments 
  • How to use the email alerts action in Process Builder

Business Use case

Warren Mason is working as a System Administrator at Universal Containers (UC). His organization wants to send out a welcome email with onboarding documents to new users as soon their accounts get created in Salesforce. 

Automation Champion Approach (I-do):

While this can be solved using various automation tools like Apex or Flow, we will use Process Builder. You can quickly send an email from a process by using Send an email action. Email alerts are configured outside of the Process Builder and contain the standard text, list of recipients, and template for an email. To send an email from a process, you must create the email alert. You can use only email alerts that are associated with the same object that the process is associated with.

Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.

Let’s begin building this automation process.

Guided Practice (We-do):

There are 6 steps to solve Warren’s business requirement using Process Builder. We must: 

  1. Create an email template
  2. Create an email alert
  3. Define process properties
  4. Define evaluation criteria
  5. Define process criteria 
  6. Add action – email alerts

Step 1: Create a Welcome Email Template 

  1. Click Setup.
  2. In the Quick Find box, type Classic Email Templates.
  3. Clicks on the New button
  4. Name the HTML Email Template and make sure to select the Available For Use checkbox.
  5. Click Next and create a template like the following screenshot: 

Step 2: Create an Email Alert 

  1. Click Setup.
  2. In the Quick Find box, type Email Alerts.
  3. Select Email Alerts, clicks on the New Email Alert button
  4. Name the Email Alert and click the Tab button. The Unique Name will populate. 
  5. For Object select User.
  6. For the Email Template choose New Employee Welcome Letter Template
  7. For Recipient Type select Email Field: Email.
  8. Click Save.


Step 3: Define Process Properties

  1. Click Setup.
  2. In the Quick Find box, type Process Builder.
  3. Select Process Builder, then click New.
  4. Name the Process and click the Tab button. The API Name will populate. 
  5. As a best practice, always input a description
  6. The process starts when A record changes.
  7. Click Save.

Step 4: Define Evaluation Criteria

  1. Click on the Add Object node to begin selecting the evaluation criteria.
  2. Select the User object from the dropdown list.
  3. Start the process only when a record is created.
  4. Click Save.

Step 5: Define Process Criteria

  1. Click the Add Criteria node to begin defining the process criteria.
  2. Name the criteria.
  3. The criteria should execute actions when the conditions are met.
  4. Set Conditions
    1. Row 1
      1. Field: User | IsActive
      2. Operator: Equals
      3. Type: Boolean
      4. Value: True
  5. Select All of the conditions are met (AND)
  6. Click Save.

Step 6: Add Action – Email Alerts 

  1. Below Immediate Actions, click Add Action.
  2. For Action Type, select Email Alerts
  3. Name the action.
  4. Select Email Alert Onboarding_Email (select the email alert which we created in step #2)
  5. Click Save.

Almost there! Once everything looks good, click the Activate button. 

Proof of Concept

Now onwards, if a system administrator creates a new user, then Process Builder will automatically trigger and add the user to the UC Internal Announcement Chatter group.

  1. Now create a new user via the UI
  2. Once the user is created, the process builder will automatically send a welcome email to them, as shown in the following screenshot:

Independent Practice (You-do):

Automatically send an email to users, when a user account gets deactivated.

Formative Assessment:

I want to hear from you!  

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? 

Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

 

9 thoughts on “Getting Started with Process Builder – Part 23 (Send a Welcome Email with Attachments to New Users)

  1. When defining when my process starts I have the following options
    1. A record changes
    2. A platform event occurs
    3. It’s invoked by by another process

    I don’t have the option of : When a record is created.

    Is there something I’m doing wrong?

  2. Hi Rakesh,
    First of all, great blog with lots of advice.

    I told you that I followed the instructions to implement a welcome mail. Step by step, however when I preview the template mail fields such as username, name, surname, etc. Always appear with my data although I advise you to do it with another.

    I did another test,

    I put the rule into operation and create a new user. Then the welcome mail arrived but also my data (username, name, surname, etc) appear.

    In the template I am using the fields of the object “user”
    In process builder I am using the object “user”

    What could be happening?

    Greetings and thanks for the help

  3. Hi Rakesh, I have just automated a process using PB. I have created an email alert for all the Object Owners when the end date is before 90 days and 30 days. I dont have any immediate actions. My criteria is to fire if the name of the record is TRUE. I have tested in 2 SB which was succesfull. Well it is partially successful in the Prod as well. After activating the PB i have updated the records to meet the new criteria. Surprisingly, The users recieved emails immediately. But there are no immediate actions and the time triggers are for 90 days and 30 days. Please help ?

    1. Lets take an example :- If a workflow rule has a time trigger set for a time in the past, Salesforce queues the associated time-dependent actions to start executing within one hour. I mean to say, if a workflow rule on opportunities is configured to update a field 7 days before the close date, and you create an opportunity record with the close date set to today, Salesforce starts to process the field update within an hour after you create the opportunity.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.