Blog

Send An Email From Record-Trigger Flow

Use Case :

When an opportunity is Closed-Won, send an email to the opportunity owner and account owner. The opportunity specifics should be included in the email template.

Trigger Flow

Using flows, there are two ways to send an email.

  • Send email using standard email alerts.
  • Compose email directly using send email action.

Compose email directly using send email action

  • Navigate to Home then search for Flows.
  • To start a new flow, click New flow.
  • Choose, Record Triggered flow.
  • Next select an Object, Opportunity.
  • Configure Trigger, when A record is updated.
  • Choose Optimise the Flow for: Actions and Related Records.
  • The Click Save.
Trigger Flow
  1. To set entry criteria, drag the decision logic element.
    1. StageName Equal to Closed Won.
    2. StageName Is Changed {!$GlobalConstant.True}.
Trigger Flow

You have now fulfilled the requirements for entering our flow. Let’s now use flow to develop an email action.

  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.
    2. Api Name :- Send_Email.
    3. Description :- Sending an email to the opportunity owner and account owner is the purpose of this action.
  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. API Name :- EmailTemplate.
    3. Body :- {!$Record.Name} has reached Closed Won.
    4. Please find the below details.
    5. Opportunity Account Name : – {!$Record.Account.Name}.
    6. Opportunity Amount : – {!$Record.Amount}.
    7. Opportunity Type: – {!$Record.Type}.
    8. Finally, click Done.
  4. Choose the email action body as {!EmailTemplateBody}.
  5. Subject :- {!$Record.Name} is Closed Won.
  6. Email Addresses (comma-separated) : –Choose Include.
    1. And Choose {!$Record.Owner.Email}, {!$Record.Account.Owner.Email}
  7. Rich-Text-Formatted Body :- Select Include.
    1. And Choose {!$GlobalConstant.True}.
  8. Click Done.
Trigger Flow
Trigger Flow
Trigger Flow

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

  1. Connect the start and action of the flow.
  2. Click Save.
  3. Click Save.
  4. Then select Show Advanced.
  5. API Version for Running the Flow: 56.
  6. Click Save

Limitation and Configuration :

  • The maximum number of recipients for emails sent from flow is five.
  • You will receive an email with HTML tags if Rich Text formatted body is not set to true.
Trigger Flow
Trigger Flow

Let’s update a record for an opportunity and see how that goes.

Trigger Flow
Trigger Flow