Microsoft Flow – Send an email with options buttons

Microsoft Flow

Sometimes with managing cases in Microsoft Dynamics 365, users want to automate sending an email to a customer and present them with some basic buttons so that the customer can choose whether to close a case without the need to reply directly to the email. In this post, I’m going to show you how we can leverage Microsoft Flow also known as Microsoft Power Automate to send the email for us with the button options.

Triggering the Flow

There are a few ways we could trigger this Flow, for the purpose of this post, I’ve created a simple tickbox on the case form and once its ticked, I will trigger the flow to send out the email.
Dynamics 365 Send Chaser field

Flow Logic

For the Flow, my trigger is set to cases and I have a condition to check if the field is equal to true (ticked).

Microsoft Flow Logic part 1

My no branch is very simple, I’m terminating the flow with a status of cancelled. I like to set the status of cancelled so I can tell if a Flow has executed any logic. This is my preference to help me troubleshoot issues, but you could set this to succeeded if you prefer.

Microsoft Flow No Condition

My Yes branch has all the logic I need to action my email with options. Firstly, I fetch the contact record associated to the case so that I can get the email address. Unlike Microsoft Dynamics 365 workflows where you would map the contact to the ‘to’ field in the email, in Microsoft Flow you need to fetch all the data manually from the system.

Microsoft Flow Yes Condition Get Contact Details

I’ve then chosen the Send Email with Options Action under Office 365. This allows me to configure the various options I want to present to the user. I’ve mapped email from the contact and also merged in some personalisation such as the contact first name. I’ve set my options as ‘Yes please close my case’, ‘my case is not resolved’ and ‘Please call me’. Based on the different options you provide, you can then action the responses appropriately.

Microsoft Flow Send Email with Options Step

I’ve then added a couple of parallel actions, the first is a switch statement that I’ll run through further down and in the last action. I’ve set a delay action to wait 4 days, send an email to say that the customer has not responded and terminate the Flow with a status of succeeded. As this is an example, I’ve kept this bit fairly simple. You could make this more complex and update the case status in Dynamics 365 or trigger some additional actions etc.

Microsoft Flow Parallel action

On the other parallel branch, my switch statement allows me to configure different outputs based on the option selected by the email recipient.

Microsoft Flow Switch Statement

The Selected Option value is an output provided by the Send email with options action.

Microsoft Flow Selected OptionMicrosoft Flow Selected Option 2

If the customer selects ‘Yes please close my case’, I’m updating a field on the record that will trigger a Dynamics workflow to close the case. You can’t close cases directly using the Update record action in Microsoft Flow. Another alternative if you didn’t want to do this is to look at potentially calling the Dynamics Web API directly from Flow to do this but that’s a post for another day. For now, we’ll update a hidden field that will trigger the closure via a workflow.
I’ve also terminated the Flow after this action so that the parallel action I mentioned above doesn’t process if the recipient has clicked on a button.

Microsoft Flow Close Case

If the recipient selected ‘my case is not resolved’, I’ve just updated the description as an example. You could update the status reason or again update a hidden field to trigger some sort of escalation process if you prefer.

Microsoft Flow Case is not resolved

If the ‘Please call me’ option is selected, I’ve created a task regarding the case due straight away for the case owner to contact the recipient. We could also send an email or post a message into a Microsoft Teams channel if that is what is required.

Microsoft Flow Request a call back

The overall Flow looks like this:

Microsoft Flow Overview

Customer Experience

Lets look at the experience from the customer’s point of view.

The recipient receives an email in their mailbox and they click the Please call me button.

3 Microsoft Flow Email with buttons in Gmail

They then get a confirmation screen that they can close when required.

Microsoft Flow Response Window

From a Microsoft Dynamics 365 perspective, as the email is sent from my mailbox I can track it to the appropriate case.

email activity in Dynamics 365

Once clicked, the task is successfully created against the case!

Dynamics 365 Task created

The run history in Flow shows us the path the Flow has taken based on the recipients selection.

Microsoft Flow Test Runs

The creation of the Flow took me about 10 minutes and its really intuitive. Microsoft Flow opens up a load of possibilities that we’ve never been able to do out of the box with standard Microsoft Dynamics 365 workflows. If you’re interested in learning and like the self-teach route, Microsoft have great content on the Flow website that you can access here. Otherwise, feel free to contact Rocket CRM for some Flow training!

About Kyle Mckie

Kyle was born in South Africa to a South African dad and an Italian mum. Kyle has spent over 10 years working in the CRM industry (8 Years with Microsoft Dynamics). Prior to setting up Rocket CRM he was working as a Senior Solution Architect for a Microsoft Gold Partner. Kyles early career was spent in Hotel management and from that he developed a passion for delivering excellent customer experiences.