Opportunity Closed Won Email Alert
Closed Won opportunity
Design
As a Salesforce User
I want to receive an automated email when an opportunity is closed won
So that I can celebrate the win with the team
Given I want to receive an email when an opportunity is closed won
When the opportunity is closed won
Then I receive an email with the opportunity details
Build
To-do:
- Create 2 custom fields on the Opportunity for Account Name and Owner Name
- Create a lightning email template
- Create email alert and choose recipients
- Create a Flow to send the email template
Create Opportunity Fields
Data Type: Formula
Field Label: Account Name Text
Description: The name of the account associated with the opportunity
Formula Return Type: Text
Formula: Account.Name
Data Type: Formula
Field Label: Owner Name Text
Description: The name of the owner of the opportunity
Formula Return Type: Text
Formula: Owner.FirstName & " " & Owner.LastName
Lightning Email Template
Email Template Name: Opportunity Closed Won
Description: Email template to send to the internal team when an opportunity is closed won
Related Entity Type: Opportunity
Folder: Public Email Templates
Subject: Closed Won Opportunity: {{{Opportunity.Account_Name__c}}}
🚀
Body:
Hi All,
Congratulations the Opportunity for {{{Opportunity.Account_Name__c}}}
is Closed Won 🎉
Here are the details:
Oppotunity Name - {{{Oppotunity.Name}}}
(make this a hyperlink to the record using {{{Opportunity.Link}}}
)
Oppotunity Owner - {{{Opportunity.Owner_Name__c}}}
Type - {{{Opportunity.Type}}}
Amount - {{{Opportunity.Amount}}}
Lead Source - {{{Opportunity.LeadSource}}}
Great work everyone!
Salesforce Automated Email
Email Alert
Description: Opportunity Closed Won Email Alert
Object: Opportunity
Email Template: Opportunity Closed Won (as above)
Selected Recipients:
- Opportunity Owner
- Account Owner
Additional Emails:
- None
from Email Address: Current User's Email Address
Flow
Type: Record Triggered Flow
Trigger: When a record is updated
Object: Opportunity
Conditions: StageName equals 'Closed Won'
When to Run the Flow for Updated Records: Only when a record is updated to meet the condition requirements
Optimize the Flow for: Actions and Related Records
Element: Send Email Alert
Action: Closed Won Opportunity Email Alert
Label: Send Closed Won Email
Record ID: {!$Record.Id}
Test
Steps:
- Update an opportunity to Closed Won
- Verify the email is sent to the Opportunity Owner and Account Owner
- Verify the email contains the correct details
Expected Result:
- The email is sent to the correct recipients with the correct details