Workflow with automated emails from list

Hello,

 I'd like to create a workflow that will read a list and send emails based on date parameters in that list. That portion is simple enough, but the issue I'm running into is on the initiation of the workflow. I don't want to manually kick this off every day, and there are no items being changed or created--the form is pulling data from a list and users are merely checking box if the data is correct. 

 For clarity, here is the high-level workflow of the form:

  1.  User receives an email (based on a due date in a static list).
  2. User click on link in email, which opens InfoPath form with prepopulated data from static list (based on URL provided in email notification in step 1).
  3. User confirms data in static list and submits the form.

 

August 27th, 2015 12:30pm

Hi Liberty- unfortunately that's not an easy process, because you're talking about a looped workflow, which isn't possible without some massaging. See the below links for solutions:

http://www.cardinalsolutions.com/blog/2014/08/simulated_recursive

http://social.technet.microsoft.com/wiki/contents/articles/24589.build-a-loop-workflow-using-sharepoint-2010.aspx

As an alternative, you could use Outlook to send out automatic reminders to check the list.

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 2:34pm

My suggestion would be to give PowerShell a try. You can write a simple script to run once a day to read data from list and send emails.
August 27th, 2015 2:46pm

Bharath,

 I like that idea -- do you have some example or sites you could share?

Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 12:20pm

Great idea with outlook reminders as we have these items in a calendar view now.

Also thanks for providing these links!

August 28th, 2015 12:21pm

To trigger an workflow using Power Shell you can follow this steps in this blog:

http://blogs.msdn.com/b/rkramesh/archive/2012/03/16/sending-email-using-powershell-script.aspx

https://gallery.technet.microsoft.com/scriptcenter/Send-HTML-Formatted-email-26925a96

You have to just add code to read data from your SharePoint list and add the content read from SharePoint list in email.

Sample code to read SharePoint list using Power Shell

$sourceWebURL = "http://sharepointsiteurl"
$sourceListName = "SharePointListName"
$spSourceWeb = Get-SPWeb $sourceWebURL
$spSourceList = $spSourceWeb.Lists[$sourceListName]
$spSourceItems = $spSourceList.Items | where {$_['ID'] -eq ID}

Hope this helps you!

Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2015 3:28pm

Hi, 

 

Here is the simple PowerShell Script for your reference: 

http://www.c-sharpcorner.com/UploadFile/anavijai/how-to-start-the-workflow-for-an-item-using-powershell-in-sharepoint-2010/ 

 

You may have to be careful, with the $list.WorkflowAssociations[0] line, if you have more workflow associations, you will have to pick the correct one to execute. 

 

Then I suggest you put the PowerShell code in the server location and configure the Scheduled Task to execute this PowerShell script every day. This is the default Scheduled Tasks option that's available in all Windows machines. 

 

About how to configure Scheduled Task for your reference: 

http://windows.microsoft.com/en-US/windows/schedule-task#1TC=windows-7 

 

Best Regards, 

 

Dean Wang

September 3rd, 2015 2:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics