Outlook

You can configure your bot to communicate with users via Microsoft email through the Graph API. By configuring your bot to access an email account, it receives a message when a new email arrives. This enables the bot to use email as a channel for responding to user inquiries. In response to a user's email message, the bot could send an email reply.

Note:  The Outlook channel is available in DRUID version 9.7 and higher and only in the cloud and hybrid DRUID deployments. You cannot activate the channel in DRUID on premise deployments.
Important!  Before you enable the Outlook channel for your bot, it's important to note that rich content flow steps (like hero cards, choice, etc.) are not supported. The Outlook channel only supports message steps.

Prerequisites

  • You have built and published a DRUID chatbot.
  • You have a Microsoft Azure account with permissions to:
    • Register applications.
    • Grant API permissions.
  • You have a dedicated user email account created in the Azure Portal for the bot to use when sending and receiving emails.

Configuring the Outlook channel

This section explains how to configure the Outlook channel.

Step 1. Register Microsoft Azure app

  1. Go to the Azure portal and sign in.
  2. In the left-hand navigation pane, select Azure Active Directory → App registrations.
  3. Register an app responsible for the management of the Outlook channel.
  4. Go to the app Overview page and copy the Application (client) ID and the Directory (tenant) ID. You will need them to configure the channel in the DRUID Portal.

You can now generate a client secret for your app.

Step 2. Generate client secret for your Azure app

  1. On the main menu, click Manage > Certificates & secrets.
  2. Click on the Client secrets tab.
  3. Click + New client secret.
  4. In the Description field, enter a short label (for example, Email secret).
  5. In the Expires field, choose an expiration period (for example, 6 months, 12 months, or 24 months).
  6. Click Add. The new client secret will appear in the list.
  7. Copy the client secret value immediately. Once you leave the page, the secret value will be hidden and can’t be retrieved again.

You can now configure the API permissions of your Azure app.

Step 3. Configure the API permissions of your Azure app

  1. On the main menu, click Manage > API Permissions.
  2. Click + Add a permission.
  3. In the Request API permissions panel, choose Microsoft Graph.
  4. Select Application permissions.
  5. Select the following required permissions:
    • Mail.Read
    • Mail.ReadBasic
    • Mail.ReadBasic.All
    • Mail.ReadWrite
    • Mail.Send
    • User.Read
    • User.Read.All
  6. Click Add permissions.
  7. The added permissions should now appear under Configured permissions.

  8. If your app uses Application permissions or the permissions require admin consent, you should wait until your admin grants access permissions for your organization.

Step 4. Configuring the Outlook channel in DRUID

To configure the Outlook channel in the DRUID Platform, follow these steps:

  1. In the DRUID Portal, select the bot, go to the bot details page and click on the Channels tab.
  2. Click on the Outlook section header. The section expands.
  3. In the Tenant Id and Client Id fields enter the values you copied from your app Overview page.
  4. In the Email address field, enter the dedicated email account created in the Azure Portal for the bot and click Authorize.
  5. Important!  Do not enter your own personal email account, 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 M365 email accounts.
  6. Click the Publish button. The channel activation might take up to 1 minute.

After the channel’s activation, the following fields are available in DRUID:

  • [[ChatUser]].ChannelId = "email"
  • [[ChatUser]].UserId - Stores the email address of the sender.