cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jgauthier
New Member

How to trigger a flow based on an action in an email

Hi all,

 

I am looking for a way for my users, to provide their confirmation directly from the emails that my flow have sent. My email would provide the following options (Working on it, Complete, Cancel). Basically the email says something line this: "Jo, you have an activity to complete by YYYY/MM/DD. Please update your status by clicking of the following links."

 

I have no hub for now, where the users can go to interact with the solution. Therefore the only way I see they can update me is by clicking the intended links in the email notifications.

 

Note: We don't have Outlook 365, therefore using the related actions is not an option for us.

 

Areas I have looked at: 

1) It seems Power Automate comes with an interesting option with the "Start and wait for an approval" action which allow to add custom options. Unfortunately, it looks like it is meant for approval (the "Approval" label is actually hard coded in the emails body). I don't know why it is so specific as I'd see other usage of this without inferring an approval process. Are there any other similar actions that exist where I could provide options so the user drives what he wants to communicate?

 

2) Another option I thought of is what if I send my email and embed custom URLs for my actions. Then, I'd have a way to trigger a flow when the url is being called. I've tried using the Http Request action but now I am stuck as I don't know whether I can call this endpoint using the POST method from an email. My understanding is that I must use POST, however if I am wrong, calling the URL and passing my few parameters using GET method would be much easier. Thoughts? Is it possible to simply invoke the Flow URL and pass the parameters (url?param1=xxxxxxx)?

 

Thank you

-Jonathan

2 REPLIES 2
yashkamdar
Solution Sage
Solution Sage

Hello Team, Well you can always use Adaptive cards where you have the Option to configure almost anything that you want.

 

Please take a look at my post below-

 

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Adaptive-Cards-in-Teams-Channel-to...

 

 

Here is have created buttons and named them Approve/Reject but basically you can do anything. 

 

I also have a button called View document in this Adaptive card where I embed a dynamic URL and allow the Approvers to go ahead and first click on this button and review the document.

 

 

yashkamdar_0-1599068823672.png

 

 

 

I think this will definitely help you, plus you can send Adaptive cards almost anywhere in the O365 platform.

 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response,

 

 

BashuBash
Frequent Visitor

Hi @jgauthier 

 

To achieve above requirement we need two workflows,

  • One is to send email with actionable messages and
  • Another workflow is to trigger and capture user response from email.

First workflow has below actions

  • Compose action with JSON adaptive card code (you can use below code).

 

 

<script type="application/ld+json">

{

    "@type": "MessageCard",

    "@context": "https://schema.org/extensions",

    "themeColor": "0075FF",

    "sections": [

        {

            "startGroup": true,

            "title": "**Activity Status**",

            "facts": [

                {

                    "name": "Activity Date:",

                    "value": "09-16-2020 04:44:22 PM"

                },

                {

                    "name": "Details:",

                    "value": "Jo, you have an activity to complete. Please update your status by clicking of the following links.."

                }

            ]

        },

        {

            "potentialAction": [

                {

                    "@type": "ActionCard",

                    "actions": [

                        {

                            "@type": "HttpPOST",

                            "body": "{\"outcome\":\"Working On It\"}",

                            "name": "Working On it",

                            "target": "url from http action of 2nd workflow",

                            "headers": [

                                {

                                    "name": "Authorization",

                                    "value": ""

                                }

                            ]

                        },

                        {

                            "@type": "HttpPOST",

                            "body": "{\"outcome\":\"Completed\"}",

                            "name": "Completed",

                            "target": " url from http action of 2nd workflow ",

                            "headers": [

                                {

                                    "name": "Authorization",

                                    "value": ""

                                }

                            ]

                        },

                        {

                            "@type": "HttpPOST",

                            "body": "{\"outcome\":\"Cancel\"}",

                            "name": "Cancel",

                            "target": " url from http action of 2nd workflow ",

                            "headers": [

                                {

                                    "name": "Authorization",

                                    "value": ""

                                }

                            ]

                        }

                    ]

                }

            ]

        }

    ]

}

</script>

 

 

 

  • Add Send an email action and enable HTML configuration and place outputs of compose action.

That’s all end of first workflow.

 

Second workflow has below actions

  • Add HTTP Request trigger and place outcome property to response from user.

 

{

    "type": "object",

    "properties": {

        "outcome": {

            "type": "string"

        }

    }

}

 

Note: As soon as you save flow, this action generates url which needs to pass in First Workflow message card action under target property.

 

  • Place Send an email action to send email with received response.
  • Add initialize variable to Refresh Card

 

{

   "@type": "messagecard",

    "@context": "https://schema.org/extensions",

    "themecolor": "0075ff",

    "sections": [

        {

            "startgroup": true,

            "title": "**thank you!**"

        },

       {

            "type":"textblock",

            "text":"we successfully received your response!"

        }

    ]

}

 

  • Add Response action to update card once after user responded to email.

That's all! hope this helps you and mark as accepted solution if it works for you.

 

Credits to this blog: https://www.about365.nl/category/blog-series/custom-actionable-messages-with-microsoft-flow/

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (5,714)