DEV Community

Divakar Kumar
Divakar Kumar

Posted on • Updated on

Build Intelligent Outlook using Azure

What problem are we trying to solve today?

Consider you are working for a company where they restricted access to outlook in your mobile or Consider you don't want to sync professional mail in your mobile. In either cases there might be a possibility where you will miss to respond back to an escalation mail or feedback mails on time .

Proposed solution :

1) We don't want to be disturbed for regular mails
2) We should make our outlook intelligent enough to know that we are only interested in escalation or feedback mails. Right now outlook can't categorize mails based on these sentiments of the contents.

So in this post, we will see how to make our Outlook intelligent enough to send out a message to our personal mobile number whenever there is an escalation / suggestion mails addressing to us.


Prerequisites :

  • Azure Logic apps
  • Azure Functions
  • Azure Cognitive services
  • Twilio

Architecture :

Steps to implement workflow :

Logic Apps workflow :

  • Choose your subscription and create Logic apps image image
  • Once logic app is created open the designer view

image

  • Select Blank Logic app

image

  • Search for Outlook in connectors and triggers and select trigger "When a new email arrives (v2)"

image
image

  • Mention your mail id in "To or CC" condition

image

  • In the next step choose Text Analytics as an operation and choose Detect sentiment (v2) as action , so that we can detect sentiment of the content of the mail

image

image

image

  • In the next step choose Azure function to categorize each sentiment score and in the request body point it to the documents of the sentiment analysis response

image
image

  • Now add condition based on the response of the azure function and if the response is ASAP or NEUTRAL , then send a text message to your registered number in Twilio account

image

image

Azure function workflow :

Based on the sentiment score , we will use azure function to categorize the content of mail that we receive.

Preview of the mail that we sent in earlier step:

image

Request to sentiment analyzer :

Alt Text

Response from sentiment analyzer :

Alt Text

And based on the below code snippet we will categorize the above mail as Negative and will tag it as ASAP message and send response back to logic app

Alt Text

Twilio workflow :

  • Once we got response from Azure function it will be send to Twilio workflow based on two conditions , It will check if the response is either ASAP or NEUTRAL . In either of these case we will trigger a message to our configured number in the portal as below

Alt Text

Act on negative feedbacks ASAP:

  • Finally, we made our outlook intelligent enough to send notifications on negative feedbacks from our client

Github Source code:

https://github.com/Divakar-kumar/SentimentWebhooks.Outlook

Further steps:

Please go ahead and fork the repository to make your outlook more intelligent, where you can implement custom logics based on the sentiment score.

Top comments (0)