How to Send an Email with Salesforce Flow

It is no secret that automation is a powerful tool in the realm of Salesforce. Automating repetitive tasks with Salesforce Flow is a massive time saver that ensures consistency in your workflow. Some of the most practical flows you can build with this tool are based around email. There are dozens of use cases for automated emails, which you can utilize across objects like opportunities, orders, cases, and more. For now, our focus will be on leads. Automatically emailing new leads ensures consistent communication and simplifies the process of converting them into opportunities. So, let's learn how to send an email with Salesforce Flow by creating a flow that automatically emails new leads to request a meeting.

Send an Email Using Salesforce Flow

Part 1: Configuring the Trigger

  1. Navigate to Setup.
  2. In the search box, type flows and go to the Flow page. Choose New Flow in the top right corner.
  3. We will create a Record-Triggered Flow, meaning that when a record is created or updated, this flow will automatically run.
    Image displaying the New Flow module with "Record Trigger Flow" as the selected core.
  4. Select the Lead object.
  5. Next, we determine when we want our flow to trigger. For this example, select Trigger a flow when: A record is created or updated. Now, every time a new lead is created or updated to meet certain conditions, the flow will trigger and email the lead.
    Image depicting a lead as the selected object, with the trigger configured to be when a record is created or updated.
  6. Set entry conditions. From the drop-down menu, select All conditions are met (AND), meaning that all the conditions must be met for our flow to run.
  7. Add conditions. These will depend on what object you are working with, but we will use FirstName, LastName, and Email for the lead object. Use the drop-down menus to select the operator for each of these as Is Null and the values as False. This ensures that the flow only affects records with a value for all of these fields.This image displays the condition requirement as "All Conditions Are Met (AND)." It also shows the FirstName field as IsNull, False; the LastName field as IsNull, False; and the Email field as IsNull, False.
  8. Under When to Run the Flow for Updated Records, we want to select the second option: Only when a record is updated to meet the condition requirements. This way, the email is only sent when a new lead is created or an existing one is updated to contain a name and email address.
  9. Optimize flow for actions and related records and select Done. Image depicting "Only when a record is updated to meet the condition requirements" selected as the When to Run option. It also shows "Actions and Related Records" as the selected optimization.

Nice! You just created the trigger for your flow! Now that we've set the conditions to start our flow, let’s configure what we want it to do.

Part 2: Creating the Action

  1. Back at the Flow Builder page, hover to reveal the (+) icon below the Start Trigger Flow button.
    Image depicting the plus button to add an action to your flow.
  2. From the module, under Interaction, select Action.
  3. In the Action search box, type send email and choose Send Email.
    The "Send Email" text is entered into the Action box in the New Action module. A dropdown menu displays "emailSimple-emailSimple."
  4. Name the action. In this case, we will just go with “New Lead Email.” The API name will autofill.
    Image displaying "New Lead Email" as the created label and "New_Lead_Email" as the API name.

Part 3: Setting Input Values

  1. Write the email. When it comes to drafting the content of your email, you have three available options:

    Option 1:
    As of Salesforce's Summer ‘23 release, you can use email templates with the Send Email action. You can do this by toggling Email Template ID to On and entering the ID of the email template you want to use. To find this ID, navigate to your email template from the Lightning Email Templates in your apps or the Classic Email Template page in setup. Then copy the 15-character string from the URL and paste it into your flow as the Email Template ID.
    Image highlighting the 15-character string in the URL of the Email Template page of a sample email template. Option 2: Store the body of your email in a text template. To do this, toggle the Body switch On. Next, select New Resource from the menu and choose Text Template. Give the template an API name and type the body of your email. You can enter custom resources from the menu above the text box. This way, you can include both static text and personalized information for the lead. Once your template is complete, click Done.Image of the text template with an sample email including both merge fields and static text. Option 3: Type the entire body of your email in the single-line body input (please don't do this).
  2. Now that we have the content of our email written, it’s time to determine who it is going to. Toggle the recipient list On and enter {!$Record.Email}. Now, the email address tied to the Lead object will automatically become the recipient.
  3. Another new feature of the Summer ‘23 release of Salesforce is the ability to log emails sent with the Send Email action. This means you can automatically update records when an email is sent, so you have a clear timeline of communication stored directly within the object record. To do this, toggle the Log Email on Send option On and set the value as {!$GlobalConstant.True}.
  4. Toggle Recipient ID to On and enter {!$Record.Id} Now, the recipient record will automatically update to show when they were contacted, what the email said, and even when they opened it.
  5. Next, toggle Rich-Text-Formatted Body On. From the drop-down menu, select {!$GlobalConstant.True}. This ensures our email formatting remains consistent. Image showing the Recipient Address List toggled on with the text box displaying {!$Record.Email} and the Rich-Text-Formatted Body option toggled on with the text box displaying {!$GlobalConstant.True}
  6. Last, toggle the Subject value to On and type your subject in the box. You can skip this step if you are using an Email Template ID. The Subject toggle is on with a custom, static subject written in the text box.
  7. Click Done, and once back in the Flow Builder screen, select Save in the top right corner, give your flow a name, Save, and then from the Flow Builder page, Activate.A module titled Save the flow is open with a flow label of "New Lead Email Flow" and a Flow API name of "New_Lead_Email_Flow"

Congratulations! You just created an automated email flow! Remember, this is just one possible use case to send an email with Salesforce Flow. Consider the scenarios where your organization repeatedly sends near-identical emails, and use what you learned here to simplify that process into a flow!

Troubleshooting

If your test flow emails aren't reaching their recipients, you'll want to double-check your deliverability settings. To do this, navigate to Setup > Email > Deliverability and make sure that your Access to Send Email level is set to All email.

If your deliverability settings look good, go to Setup > Email > Test Deliverability to check whether your recipients are blocking any of the IP addresses Salesforce uses to route emails.

Do More with Automation in Salesforce

Sending emails with flow just scratches the surface of possible automation within Salesforce. If you want to explore more with automation, check out Drive Connect– The easy-to-use Google Drive and Salesforce integration that lets you take automation to the next level with automated folder structure and document generation. It installs in just a few minutes, and you can try it free for 14 days with no credit card required.

 

Automate your workflow with Drive Connect

Try Drive Connect free for 14 days- no credit card required.

Get Started