Create workflow on incoming email in SharePoint documents library 

Based on the information in this article, you will be able to design a SharePoint 2010 custom workflow on a document library with items created by incoming e-mail method. (Estimated time to achieve that is around 30-45 minutes)

 

 

 


1- First of all, we have check in SharePoint server setting if workflow trigger on email is enabled or not, and enable it.

Using STSADM 

Open the SharePoint 2010 Management Shell as administrator and run following command:

stsadm -o getproperty -pn declarativeworkflowautostartonemailenabled

Output should be:

<Property Exist="Yes" Value="yes" />PS 

If Value of property is “No” you have to enable it by typing following command:

stsadm -o setproperty -pn declarativeworkflowautostartonemailenabled -pv true.

Using PowerShell

This property was somewhat easier to set using STSADM, however keep in mind that STSADM is being retired. PowerShell is the command line administration tool to use moving forward.

Open the SharePoint 2010 Management Shell as administrator and run the following to determine the value of the DeclarativeWorkflowAutoStartOnEmailEnabled property:

$spWebService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$spWebService.DeclarativeWorkflowAutoStartOnEmailEnabled

If the Value of the property is "False" you have to enable it by typing the following commands:

$spWebService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$spWebService.DeclarativeWorkflowAutoStartOnEmailEnabled = $true
$spWebService.Update()



2- Enable Incoming E-mail on the Farm.

Form Central Admin è System Settings è E-Mail and Text Messages (SMS)
Click on “Configure incoming e-mail settings”

Enable Sites on serverv to revive E-mails.

 

And set the STMP server on SharePoint

   

Click OK to save changes.



3- From library level:

Open the document targeted document library

Ribbon menu è Library èLibrary settings è under the communications column. 

Click “Incoming e-mail settings”.

Enable the document library to receive e-emails and add email receiver name that will be received and rout documents to this list and it should be unique name than another email on another document.

 

Click OK to save changes.



4- From SharePoint designer level:

Open SharePoint SPD and connect to the site contain the targeted document library è open workflow menu form the side navigation window.

 

Form the ribbon menu click on List workflow and pick document library need to associate the workflow on it. 
Writ the workflow name and put the description.

Workflow Editor Window will open.

From the ribbon menu add action è inside task action sector chose “Start Approval process”

 

Now new action added as a line on the workflow editor

  

Now we’re going to set task process participants users, by clicking the “these users” link

And pick the users from SharePoint groups or single users.

 

In the first field, add the participants IDs and there is an option to send the task to the users I in parallel or one at time (sequential).

And here is a snapshot for the sequential approval task for 2 exists groups, from top to bottom.

 

So the task will be assigned to Hierarchy Managers group è if approved è  Approvers group.
No need to add any title or instructions but may you need to set the task duration time and due process date if required.

Finally we need to trigger this workflow when an item added to the document library.
So, we have to click Workflow settings form the ribbon menu.

Then under the Start Options group box, check the start workflow option automatically when the item is created as below:

 



Now it’s ShowTime :)

    -    Save and publish the workflow from the ribbon menu.
    -    Send an email with attached document to email ID which is set on the point number 3 above.

And check the document library new item



You will notify that, there is a new column added named as workflow name created on step number 4 above and contain the status of the workflow.
Let’s click on the “In Progress” link

 

So the task been assigned to the Hierarchy group automatically and after open it and approve it, it will assigned to next group (approvers as set before).