Notify public group
Opportunity Stage Change Alerts
Design
As a Salesforce User
I want to be notified via email when a Opportunity stage is changed
So that I can take appropriate action
Given I want to be notified when a new Opportunity is changed to the following {stages}
When the stage is changed
Then I should receive a notification with a short summary and a link to the Opportunity record
Build
Task Name: Notify users when Opportunity stage is changed
To Do:
- Create 2 custom fields on the Opportunity for Account Name and Owner Name
- Create an email template
- Create an email alert
- Create a flow to send the notification
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 Stage Change Notification
Description: Email template to send to the internal team when Opportunity status is changed
Related Entity Type: Opportunity
Folder: Public Email Templates
Subject: Opportunity in {{{Opportunity.StageName}}}
: {{{Opportunity.Account_Name_Text__c}}}
🔔
Body:
Hi All,
Opportunity for {{{Opportunity.Account_Name_Text__c}}}
has moved to {{{Opportunity.StageName}}}
stage 👀
Here are the details:
Oppotunity Name - {{{Opportunity.Name}}}
(make this a hyperlink to the record using {{{Opportunity.Link}}}
)
Oppotunity Owner - {{{Opportunity.Owner_Name_Text__c}}}
Type - {{{Opportunity.Type}}}
Amount - {{{Opportunity.Amount}}}
Salesforce Automated Email
Email Alert
Description: Opportunity Stage Change Email Alert
Object: Opportunity
Email Template: Opportunity Stage Change (as per above)
Selected Recipients:
- Opportunity Owner
- Account Owner
Flow
Flow Label: Opportunity: Stage Change Alerts
Description: Flow to send an email alert when Opportunity stage is changed
Flow Type: Record Triggered Flow
Object: Opportunity
Trigger: A record is updated
Criteria:
- Field = StageName
- Operator = Is Changed
- Value = True
Element Type: Send Email Alert
Email Alert: as per above
Label: Send Email Alert
Record ID: {!$Record.Id}
Test
Steps:
- Create a new Opportunity
- Change the stage of the Opportunity
- Check the email inbox for the notification
Expected Result:
- Email notification is received when the stage is changed