The Case of Custom Ouf Of Office

In 2006-07, when I was writing Windows Mobile apps, I really enjoyed using MessageInterceptor type. Using that, we could build our own workflows based on Text Messaging. For example, send an SMS to the device and if SMS contains “Play”, play a song. If SMS contains “Stop”, stop playing the song. And what not. Oh, and I could say if the message is from my parents, reply “I’m in college” and if from friends reply as “I’m waiting outside the movie theater”.

However, I missed this functionality for a long time with different devices (lack of message intercepting API on some platforms). And recently I eagerly wanted to have it for the email, considering the heavy influx of emails in my new role. I got to know about Azure Logic App Service and thought, perhaps let’s go ahead and build something similar. And for me, this is a fantastic way to learn something new.

Scenario: Let’s build a solution which will read incoming email messages and if the message is from one particularly annoying friend, let’s reply with an equally annoying message. If it is from my manager, let’s reply with some positive update and if from a customer we’ll reply with actual OOF. Well, a lot of email service providers allow you to setup OOF, but it is not customizable for different emails. Outlook in Office 365 allows 2 separate OOF messages, one for members within your organization and one for outside organization. Our solution will provide more customizations.

Step 1: Create Azure Logic App Service

Navigate to Azure Portal and Create a resource. Search for Logic App and click on ‘Create’. Give it a name, select the subscription, create Resource Group and finally select a location near to you.

01. Create Logic App

Once Logic App is created, scroll down the next screen and click on ‘Blank Logic App’. This will allow you to add the logical functionality to the just created app.

02. Blank Logic App

Step 2: Design Logic App – Use Connector & Trigger

Connectors allow you to connect your logic app with the desired service. In our case, we’ll use Office 365 Outlook connector to connect to the mail service. And once you connect to the service, there will be a Trigger to activate the logic app. Again, in our case, it will be an email arriving in our inbox.

03. Logic App Connector & Trigger Webhook

Once you select the connector and trigger, sign in with your credentials and connect the email service with your logic app.

Step 3: Setup the Rule and Switch Case

On this screen select the folder in your mailbox to monitor and other aspects of the email. Click on ‘+ Next step’ and write define your logic.

04. Logic App Switch Case

Depending on the connector selected, you’ll see different options for the switch case. For example, in case of Outlook connector and Email trigger, there can be conditions to check for who has sent the email, if it has attachments, if it has importance set or if it has been sent directly to me or to any distribution list to which I’m subscribed.  These conditions will vary depending on trigger and connector.

05. Logic App Switch Options

Once the Switch is set, let’s set up the cases. Here, I’m checking if the email is from Vikram (Oh, he isn’t the annoying friend :) ) and setting up a reply for him. I can also repeat this for many more senders.

06. Logic App Case Vikram

The next one is for my manager Joao,

06. Logic App Case Joao

You can add as many cases as you want and ultimately add a default case. At the end, the logic app designer will look something like this:

06. Logic App Entire Logic

Finally, once this step is done, Run the logic app and wait for the magic to happen :)

07. Logic App Run

In this situation, if a user sends you an email and if the user falls under the cases, the user will receive the response accordingly and if not, user will receive the default response.

Conclusion:

Logic Apps Service makes it easy to write workflows and automate tasks. And even though we used Logic Apps for email workflow, there are connectors available for different services which you can find here. If this list doesn’t cover your service, you can write one on your own connector and documentation for the same is available here.
Don’t forget to ‘nuke’ the resource group once done with it or you’ll keep replying to all your emails – automagically. :)

Happy coding (or designing workflows :) ).
Namaste,
Mayur Tendulkar

 

 

 

 

 

 

 

Advertisements

#365 Admin

I carpool to work with Dev. We enjoy our ~45 mins. ride and while traveling we listen to 80’s/90’s songs (If given a chance he would kill me for my choice of songs Smile) and also talk about various things at our day-to-day job and how those can be automated. One of the thing that we discussed was basic – User Management. E.g. adding a user, resetting password, etc.… So, we thought about enabling IT admins to manage their Active Directory remotely.

Recently, I was working on a project where we had to use Azure Active Directory for user management. And I thought it can add value if ported on mobile. So – #365 Admin.

Using this tool, IT admins can browse through users, reset their password or add a new user. This is v1.0 release and I’m planning to add more features and release updates once in a month or as and when ready/required.

Thanks to Girish, Aviraj and Vittorio for all their support while building this app.

The app is certified in the store and will be available in general in coming weeks.

Thanks,
Mayur Tendulkar

Build Windows Phone Apps In A Jiffy

Want to build Windows Phone apps? Don’t know anything about development or just want to get started, build working POC and hand-over to professional for final touch? Or just want to try your hands on Windows Phone development? This is the ‘right time’.

Today, Microsoft announced a Windows Phone App Studio for the savvy developer filled with great ideas but not enough time.

1

You can create apps in just 4 steps.

  • Select a template
  • Add content (static or dynamic like RSS feeds, HTML, etc…)
  • Choose the style, logo, design or do full customization
  • Use it, Share it, Publish it

2

The app created using this has a high-standard code and is ready to publish on Windows Phone store. Just download the package and publish it using your publisher account on Windows Phone Store. Don’t have one? Well, you can get one in just $19 “Summer Break” limited-time Dev Center registration offer (through August 26, 2013).

I hope, this will help you to get started with Windows Phone development and build that one mobile app, you always wanted to build Smile

Resources:

Namaste
Mayur Tendulkar