How to send email using flow in salesforce

Hello Everyone in this post let’s understand how to send email using flow in salesforce using email alert, using send email core action, Also the summer 23 updates related to email.

If you are not followed our previous blog post feel free to check it out. Salesforce Lightning Tutorial For Beginners.


After reading this Blog you can able to understand how to use the ‘Send Email’ core action to send a formatted rich text email and how to use email alert to send email in salesforce using flows, also summer 23 updates.

Business Use Case

Send an email to the Opportunity owner when an opportunity is Closed-Won. The email template should include Opportunity details.

There are two ways to send an email using flows.

  1. Send email using standard email alert.
  2. Send/Compose email directly using send email action.

Send Email Using Salesforce Flow

1. Send/Compose Email Directly using send Email Action.

  1. Go to Home then search for Flows.
  2. Click New flow to create new flow.
  3. Choose, Record Triggered flow.
  4. Then Choose Object, Opportunity.
  5. Configure Trigger, when A record is updated.
Record Triggered Flow
  1. Choose entry Criteria.
    1. StageName Equal to Closed Won.
    2. StageName Is Changed {!$GlobalConstant.True}.
  2. Choose Optimize the Flow for:
    1. Actions and Related Records.
  3. The Click Save.
Flow Entry Criteria
Entry Criteria
Optimize flow for

Now you are done with the entry criteria of our flow. So now let’s create an email action using flow.

  1. From the toolbox drag Action interaction to the screen/Canvas.
  2. Next in Action search for Send Email.
    1. Choose a label :- Send Email to Opportunity Owner.
    2. Api Name :- Send_Email_to_Opportunity_Owner.
    3. Description :- This action is to send an email to the Opportunity owner.
  3. In Input Values, lets create a body using new resource and make this as a dynamic.
    1. Hover in body, then click for new resource.
    2. Resource Type :- Text Template.
    3. API Name :- EmailTemplateBody.
    4. Body :- Good News!!. You woned the Opportunity you owned {!$Record.Name}.
    5. Please find the below details for your reference.
    6. Opportunity Amount : – {!$Record.Amount}.
    7. Opportunity Discount :- {!$Record.Amount_After_Discount__c}.
    8. Opportunity Account : – {!$Record.AccountId}.
    9. Then Click Done.
  4. Choose email action body as {!EmailTemplateBody}.
  5. Subject :- You just woned a Opportunity.
  6. Email Addresses (comma-separated) : –Choose Include.
    1. And Choose {!$Record.Owner.Email}.
  7. Rich-Text-Formatted Body :- Choose Include.
    1. And Choose {!$GlobalConstant.True}.
  8. Click Done.
New Action
New resource
Text Template new resource
Action email

Note: – If you do not set Rich Text formatted body to true, then you will receive an email with HTML tags.

Once you are done with the flow below method to connect and save the flow.

  1. Connect the flow from start to Action.
  2. Click Save.
  3. Enter Flow Label and the API Name will auto-populate.
  4. Click Show Advanced.
  5. API Version for Running the Flow: 51
  6. Interview Label: Rich Text – Example {!$Flow.CurrentDateTime}
  7. Click Save
Save the flow

Congratulation now we are done with our flow. Let’s take a look at it.

2. Send Email Using Standard Email Alert

Let us take the same business use case here and achieve it using email alert using flows. To use email alert action in your flow follow the below steps.

To use email alert we should have an email template. so let’s create an email template as below.

Emaiil template

Once created email template, let’s create an email alert and will choose the above email template in the email alert.

email alert

Once all prerequisites are completed, let’s see how to use this email alert in flow action.

  1. Drag action to the canvas.
  2. Then Choose filter by Types.
  3. Then in email alert choose the email alert you have created.
  4. Choose a label :- Send Email through email alert.
  5. In set input value choose Record ID: – {!$Record.Id}.
  6. Then click done.
email alert in flows

Now we are done with the email alert, let’s see what our final flow looks like.

send email using email alert in flows.


Now let’s update an opportunity record and let’s see how its works.

Opportunity record update
Send Email Proof

3. Summer 23 Updates on Email Core Action

The Summer ’23 update of Salesforce brings significant enhancements is Salesforce Flow’s email core actions. Lets check out them.

Input Values

  • Body: This is the body of the email. It is required if you are not using an email template. It is possible to type a text or create a text template (rich or plain text) and provide it as a resource.
  • Email Template ID: This is the Id of the Classic or Lightning email template to use for the email subject and body.
  • Log Email on Send: It is a boolean that indicates whether to log the email on the specified records’ activity timelines and activity history. To log an email, you must specify a value for Recipient Id, Related Record Id, or both.
  • Recipient Address Collection: This is a text collection of the recipients’ email addresses. It is possible to enter a value for Recipient Id, Recipient Address List, and Recipient Address Collection as long as the total number of email addresses is five or fewer.
  • Recipient Address List: This is a comma-delimited list of the recipients’ email addresses.
  • Recipient ID: This is the Id of a lead, contact, or person account record. You must provide a value if you are using an Email Template. If Log Email on Send is true, this parameter becomes the Id of the person to send and log the email to. If there is an Email Template Id, this parameter is the Id of the person to send an email to and populate recipient merge fields with. If you enter a Lead Id, you can’t use Related Record Id.
  • Related Record ID: This is the Id of a non-recipient record. For example, the Id of an opportunity record. If there is an email template, this parameter is the Id of the record for populating email template merge fields.
  • Rich-Text-Formatted Body: This is a boolean that indicates whether you want the resource specified for the Body parameter to use rich text.
  • Sender Email Address: It is the organization-wide email address for sending the email. It is required when Sender Type is OrgWideEmailAddress.
  • Sender Type: Type of sender that the email is sent from. Valid values are CurrentUser (default value), DefaultWorkflowUser, and OrgWideEmailAddress.
  • Subject: It is the subject of the email and it is required if you are not using an email template.

Note : Above input values credit goes to

Now we are using same business case, i.e, if Opportunity is won then send email to Opportunity owner. So as per that i added below input values in email core actions.



In this post, we saw how we can send email using 2 different methods using flow. And also we saw what is changed in Summer 23 related to core email action.

Feel free to other blog post related to lightning. If you liked this blog post feel free to share it with your friends, until then we will meet you in another flow series blog post.

Sharing Is Caring:

8 thoughts on “How to send email using flow in salesforce”

Leave a Comment