Let's configure an automated email notification to alert the Sales agent about the Agreement's end date. You can use Standard Salesforce tools to configure email notifications.
Before we start, make sure that you have the appropriate permissions to create Flows and work with objects from the Maven CLM package.
Open Setup and search for Flows in the Quick Find Box.
Open Flows.
Click the New Flow button to create a new Flow.
In this example, we want the Flow to run daily at the set time. For that purpose, Schedule-Triggered Flow suits us the best. Click Create.
In the Set Schedule setting, set today as the Start Date. For the Start Time, set 8:00. In the Frequency field, select the Daily option.
When the Flow is completed, the Sales team will receive 8:00 AM morning notifications in case certain conditions are satisfied.
After these steps, you will see the Flow canvas, where you'll operate with the Flow components. So let's get straight to business.
First, we need to do some pre-work and create a Variable which will count the termination dates of the Agreement:
On the left section of the Flow Builder, open the Toolbox and click New Resource.
Create a Formula Variable using the screenshot below as a reference
Now, add Flow elements.
Click the Add "+" element between the Start and End points and select the Get Records element. With this element, we will get all agreements whose end date is less than or equal to the expiredDate variable. We will use this information in the next Flow element. Take a look at the screenshot below to fill in the element's fields.
Next, we need to iterate through all the records obtained from the previous request. To do this, create a new Loop element, and select the agreement records previously obtained from the request as a collection.
The next thing we need to do is create a template for the email. Select New Resource in the toggle toolbox (in the same way as when creating the expired date variable). Select Text Template as the resource type, and in the body field, write "{!For_Each_Agreement.Name} is coming to its end."
You can refer to any fields in the Agreement by clicking "Resource Picker" and choosing the desired field in the "Current Item from Loop For_Each_Agreement" variable.
The preparation is complete. Now, we can create the email notification element.
Create an Action element inside the Loop and complete the configuration based on the screenshot below. In this step, we will choose the text template created in the previous step.
The last step is to save the Flow. It will send an email notification to the Sales team (primary contacts on the Agreement) every day at 8 Am, in case the Agreement expires in the next 10 days.
Click the Save button in the top right corner. Choose the name for your email notification Flow.
In this example, we will name the Flow AgreementEndDateNotification.
Make sure to activate the Flow after saving.
In the screenshot below, you can see what the Flow should look like.