Κοινή χρήση μέσω


Connect a bot to the Outlook channel for Actionable Messages (Preview)

APPLIES TO: SDK v4

Actionable Messages allow users to take quick actions from within Outlook. When you connect a bot to the Outlook Actionable Messages channel, your bot can use Adaptive Cards to create actionable messages, enhancing user engagement.

Note

The Outlook channel for Actionable Messages is in public preview. Features included in preview might not be complete, and might undergo changes before becoming available in the public release. They're provided for evaluation and exploration purposes only.

Warning

It's a violation of the Bot Framework Code of Conduct to create "spambots", including bots that send unwanted or unsolicited bulk email.

Prerequisites

Note

  • Don't use your own personal email accounts for bots, as every message sent to that email account will be forwarded to the bot. This can result in the bot inappropriately sending a response to a sender. For this reason, bots should only use dedicated O365 email accounts.
  • If you use Microsoft Exchange Server, enable Autodiscover before configuring the email channel.

Design the messages

The Outlook channel for Actionable Messages sends and receives Adaptive Cards over email.

You can use the Actionable Message Designer to design and test actionable message cards.

Important

The universal Bot action model is introduced in the Adaptive Cards schema version 1.4. To use these new capabilities, the version property of your Adaptive Card should be set to 1.4 or later. See Action.Execute in the Adaptive Cards Schema Explorer.

Implement and deploy the bot

The general flow is for the bot to send an actionable message to a user and then handle the user's action.

  1. When the user responds to the card in email, Outlook sends an invoke activity to the bot. The activity's value property contains an action object with type, verb, and data properties. For example, the activity would include the following information, where the verb and the data correspond to information on the card the bot sent out initially.

    "type": "invoke",
    "name": "adaptiveCard/action",
    "value": {
      "action": {
        "type": "Action.Execute",
        "verb": "<DEVELOPER_DEFINED_VERB>",
        "data": {
          // DEVELOPER_DEFINED_PROPERTIES
        }
      },
    }
    

    See Action.Execute in the Adaptive Cards Schema Explorer for the complete object schema.

  2. The bot handles the incoming invoke activity and returns a result that includes a new Adaptive Card that will take the place of the original Adaptive Card. The invoke response might look like:

    {
      "statusCode": 200,
      "type": "application/vnd.microsoft.card.adaptive",
      "value": <UPDATED_ADAPTIVE_CARD>
    }
    

Request access

  1. Open your bot resource in the Azure portal.
  2. Open the Channels pane.
  3. Select the Outlook channel.
  4. On the Configure Outlook page, select please register here.
  5. Fill out the registration form to request access. See Register your service with the actionable email developer dashboard for more information.

Next steps