none
Send Email Reminders from SharePoint workflow Programmatically.

    Question

  • HI All,

    I have to send reminder and escalation emails from state machine workflow . The scenarion is something  like this:-

    1. Send First mail when the action is selected "Waiting for Approvar".

    2. If the response not come form the user than a reminder mail will send after 3 days of the first mail.

    3. If again the response not come on the reminder mail than another reminder mail send after  3 daya of the first reminder mail.

    4. Finally if there is no response than an escalation mail trigger aftre 10 days of the first mail.

    Please suggest how can i achive this in state machine workflow .

    Regards,

    Sachin

    SachinKumar

    Monday, June 04, 2012 7:45 AM

Answers

  • Well i got the solution:-

    1) I have used a while loop and inside the while loop i have take a code activity and inside the code activity checks the duedate.

    2) If the Due Date is <the current date than the code always return true and the while loop continues running.

    3) If the Due date >= the current date than based on some other condition a Reminder mail will send .

    If any one have the better approach than this than let me know.


    SachinKumar

    • Marked as answer by Sachin Dagar Wednesday, June 20, 2012 7:17 AM
    Wednesday, June 20, 2012 7:17 AM

All replies

  • Hi,

    You don't have problem to do this:

    Create a workflow:

    if waiting for approval

    Send email reminder.

    Add 3 days to today (results to var:date)

    stop to date

    if waiting for approval

    send email reminder

    add 10 days to today (results to var date)

    stop to date

    if waiting for approval

    send email reminder

    Regards.


    Tomás González. Twitter://@tgmourino

    Monday, June 04, 2012 8:17 AM
  • Thanks for the reply.

    I am developing workflow in visual studio 2010 not in SPD. Can i perform the above solution in visual studio.


    SachinKumar

    Monday, June 04, 2012 8:41 AM
  • Hi All,

    Is there any solution?


    SachinKumar

    Wednesday, June 06, 2012 5:26 AM
  • Are you looking for actual code to send an email? Or the workflow flow?
    Wednesday, June 06, 2012 6:30 AM
  • HI ,

    I am not looking for actual code but i need to know the approach to get this functionality through VISUAL STUDIO 2010. I know the flow in SPD.


    SachinKumar

    Wednesday, June 06, 2012 10:59 AM
  • Well i got the solution:-

    1) I have used a while loop and inside the while loop i have take a code activity and inside the code activity checks the duedate.

    2) If the Due Date is <the current date than the code always return true and the while loop continues running.

    3) If the Due date >= the current date than based on some other condition a Reminder mail will send .

    If any one have the better approach than this than let me know.


    SachinKumar

    • Marked as answer by Sachin Dagar Wednesday, June 20, 2012 7:17 AM
    Wednesday, June 20, 2012 7:17 AM
  • Hi Sachin,

    I have similar situation( to send reminder emails 30 days prior to review date) and I have to use Visual Studio workflow.

    Can I meet this requirement using State machine workflow? can you share your code concept?

    Tuesday, July 10, 2012 8:41 PM
  • Hi Sachin,

    I have similar situation( to send reminder emails 30 days prior to review date) and I have to use Visual Studio workflow.

    Can I meet this requirement using State machine workflow? can you share your code concept?

    Hi,

    I believe a timer job will be better suited than a workflow?

    Thanks and have a great day!


    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.

    Wednesday, July 11, 2012 7:20 AM
  • Hi Van,

    We can't use timer job due to server team constraint. Dont ask me why :(

    Only option we have is to use VS workflow(no SPD workflow option also allowed). 

    Do you have any suggestion ?

    Monday, July 16, 2012 5:07 PM
  • There's a chunk missing in the OP's approach that is vital to the solution here.

    Namely, you'd have to use a DelayActivity to periodically wake the workflow up and check its status.

    Also, there should be a warning that the DelayActivity requires that SharePoint be set up thusly:
    http://howtosharepoint.blogspot.com/2010/05/sharepoint-workflow-delay-activity-not.html

    That said, if all the workflow does is send email, then I'd strongly recommend checking out an alert utility like SharePoint Alert Reminder Boost. It's highly customizable, reusable for any list/library and it probably saves money over custom workflow development:
    http://www.sharepointboost.com/sharepoint-reminder.html

    Tuesday, July 17, 2012 12:42 AM
  • Hi Werner van der bank ,

         I having same requirement , send an email when task is over due using sequential workflow , can share code concept .I appropriated.

        so far i tried different approaches. in CAG , i put delay activity then add send email activity . but it

    seems i missed something . i stuck in this problem for 2 days . so please help me out .

    Thanks

    Job 10


    • Edited by Job10 Friday, December 07, 2012 2:34 PM
    Friday, December 07, 2012 2:25 PM
  • Hii

     I ve tried same thing , and it works only thing is .... what to do if we want to do TWO escalations means how can we use two delay activities in one code(note: I am using state machine workflow so cant use two delay activities in one event driven activity).

    If u have suggession for that .... then please go ahead.


    Hope this helps, Thanks & Regards | Swapp1987

    Wednesday, January 09, 2013 6:04 AM