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](https://www.innovalleyworks.com/wp-content/uploads/2022/12/1.png)
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](https://www.innovalleyworks.com/wp-content/uploads/2022/12/send-an-email-01-1024x575.jpg)
- To set entry criteria, drag the decision logic element.
- StageName Equal to Closed Won.
- StageName Is Changed {!$GlobalConstant.True}.
![Trigger Flow](https://www.innovalleyworks.com/wp-content/uploads/2022/12/send-an-email-02-1024x575.jpg)
You have now fulfilled the requirements for entering our flow. Let's now use flow to develop an email action.
- From the toolbox drag Action interaction to the screen/Canvas.
- Next in Action search for Send Email.
- Choose a label :- Send Email.
- Api Name :- Send_Email.
- Description :- Sending an email to the opportunity owner and account owner is the purpose of this action.
- In Input Values, lets create a body using new resource and make this as a dynamic.
- Hover in body, then click for new resource.
- API Name :- EmailTemplate.
- Body :- {!$Record.Name} has reached Closed Won.
- Please find the below details.
- Opportunity Account Name : – {!$Record.Account.Name}.
- Opportunity Amount : – {!$Record.Amount}.
- Opportunity Type: – {!$Record.Type}.
- Finally, click Done.
- Choose the email action body as {!EmailTemplateBody}.
- Subject :- {!$Record.Name} is Closed Won.
- Email Addresses (comma-separated) : –Choose Include.
- And Choose {!$Record.Owner.Email}, {!$Record.Account.Owner.Email}
- Rich-Text-Formatted Body :- Select Include.
- And Choose {!$GlobalConstant.True}.
- Click Done.
![Trigger Flow](https://www.innovalleyworks.com/wp-content/uploads/2022/12/send-an-email-03-1024x575.jpg)
![Trigger Flow](https://www.innovalleyworks.com/wp-content/uploads/2022/12/send-an-email-04-1024x575.jpg)
![Trigger Flow](https://www.innovalleyworks.com/wp-content/uploads/2022/12/send-an-email-05-1024x575.jpg)
Once you are done with the flow below method to connect and save the flow.
- Connect the start and action of the flow.
- Click Save.
- Click Save.
- Then select Show Advanced.
- API Version for Running the Flow: 56.
- 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](https://www.innovalleyworks.com/wp-content/uploads/2022/12/send-an-email-06-1024x575.jpg)
![Trigger Flow](https://www.innovalleyworks.com/wp-content/uploads/2022/12/send-an-email-07-1024x575.jpg)
Let's update a record for an opportunity and see how that goes.
![Trigger Flow](https://www.innovalleyworks.com/wp-content/uploads/2022/12/send-an-email-08-1024x575.jpg)
![Trigger Flow](https://www.innovalleyworks.com/wp-content/uploads/2022/12/send-an-email-09-1024x575.jpg)