Sending Custom Actionable Messages via Flow

Actionable Messages is a way that we can send a small bit of JSON within an email message, it gets picked up by Outlook (Web, App, Desktop, Mobile) and parsed as quick actions, or a way to collect additional information.

We can easily create Actionable Messages with Microsoft Flow, and this will extend our ability to build "disconnected human workflows"

Plan

  • Use MessageCard Playground to build our JSON
  • Send Actionable Message via Microsoft Flow as HTML embed

Message Card Playground

https://messagecardplayground.azurewebsites.net/

Use Message Card Playground to quickly try a few templates and see the JSON we need to build.  

Microsoft Flow's "Send with Options" as well as "Approval" actions use Actionable Messages - you can see the templates that's used.

Build a custom message with Flow

The Flow is quite simple.  A trigger, build a custom HTML string, then Send Mail with HTML.

flow.png

My test compose has this JSON

 <script type="application/ld+json">{
    "@context": "http://schema.org/extensions",
    "@type": "MessageCard",
    "originator": "Provider-id-from-developer-dashboard",
    "hideOriginalBody": "true",
    "themeColor": "0072C6",

 "sections": [
        {

            "heroImage": {
                "image": "https://minecraft.net/static/pages/img/addons-feature.8b0a274be963.png",
                "title": "This is the image's alternate text"
            },

    "title": "John how are your Flow and Minecraft doing?",
    "text": "Click **Learn More** to learn more about Actionable Messages!",
}],
    "potentialAction": [
      {
        "@type": "ActionCard",
        "name": "Send Feedback",
        "inputs": [
          {
            "@type": "TextInput",
            "id": "feedback",
            "isMultiline": true,
            "title": "It is doing great!"
          }
        ],
        "actions": [
          {
            "@type": "HttpPOST",
            "name": "Send Feedback",
            "isPrimary": true,
            "target": "http://..."
          }
        ]
      },
      {
        "@type": "OpenUri",
        "name": "Learn More",
        "targets": [
          { "os": "default", "uri": "https://docs.microsoft.com/en-us/outlook/actionable-messages" }
        ]
      }
    ]
  }
  </script>
<p>
Hello, please take an action.
</p>

A few notes - I did not register this JSON, so I'm only sending this to myself for testing.  This will ONLY work within my current tenant and internal email addresses.

Additionally, this doesn't seem to work on mobile Outlook.  I assume if I'm taking this to mobile I will need to submit and register the action.

https://docs.microsoft.com/en-us/outlook/actionable-messages/actionable-email-dev-dashboard

Make sure Send Email sends HTML

send-option.png

Results

I receive this in my Outlook (Web) mailbox.

email.png

What can we build with this?

In the JSON for Potential Action - we can specify HttpPost actions.  This is idea to chain into a new Flow action and start a new step.

I think about the "Pick your own adventure books".  Each time this runs, it presents me with the next chapter of the story, with buttons that lets me choose what's the next step to take to continue my journey.

So this is another piece of the tool that we can mix into our toolset.