Category Archives: Visual Studio Sequential Workflows

Lazy Approval with SharePoint – approve task via email part 1

Don’t you wish that Sharepoint would give you a way to approve documents or tasks via email, and not have to login to a VPN to gain access to the corporate intranet site?  Wouldn’t it be nice if there was a way to just click a link in the email to approve or reject a task on any device?

This is what a “lazy approval” is.  Currently, i know of one company (as of the writing of this post) that has a lazy approval system as a Sharepoint add-in, and this one feature (packaged with many other Sharepoint improvements of course) costs $5,000.  Well, I didn’t need all these other features!  I just want to reply to an email and be done with it.

In order to make a lazy approval happen, there are going to be three main components to this:

  1. we will setup a library on the main sharepoint site to accept emails from the users
  2. we need an approval task in a workflow that will send the task notifications with specific formatting
  3. we need a workflow developed in Visual Studio 2010 that will parse through an email and approve for the user.

It doesn’t seem too hard, right?   In the following posts, we will setup each of these things, i will provide sample code, screenshots and the setup of the items to make this all work.

Setup a library to accept incoming emails

This is a very easy thing to do.  In sharepoint central admin, you must have incoming mail setup.  In the “system settings” section of central admin, you will click on the “Configure incoming e-mail settings” link.

NOTE: This article assumes you have already setup outgoing e-mail settings properly.

central administration - system settings

In this section, enable sites to receive email, and set all applicable SMTP settings.

system settings pageYour IT department or mail administrator should be able to help you get this setup properly.

Once you get this setup, then we need to move on to the library that will accept incoming emails.  I setup a library called “Workflow Response” at the top-level site as a document library and choose NONE as the document template.  I do not show this on the left-side navigation links, since people don’t need to see these emails as they come in.

Next, go to library settings and click the “Incoming e-mail settings”.incoming e-mail settings

You will be brought to the mail setup page for the library.  Make sure to select the option to “save original e-mail”!!!

Once you have setup the library to accept email, then test it by sending an e-mail message to the address you supplied for the library, in this case sharepointsite@server.domain.local.

Now we are ready to move on to the next part, setting up an approval workflow in Sharepoint Designer.


Part 2:

Part 3: