Home » SharePoint » Create a Simple Time-Based Email Reminder for SharePoint Calendar Events

Create a Simple Time-Based Email Reminder for SharePoint Calendar Events

This falls under the category of “Why can’t SharePoint do that out of the box?”.
See if this sounds familiar:
You’re a good SharePoint user, storing documents in a library and collaborating with your coworkers, and using a calendar to store team dates.  Someone says to you “Hey I want to get an email reminder for these events on the team calendar”.  You think well, we can set alerts, so you go look into the alert settings, and quickly realize that alerts don’t work like that.  The alert mechanism in SharePoint will send the alert subscriber an email based on an action happening on the item (it is being created, edited, etc).  We need the trigger to be based on a date.  So what to do?  There are typically 3 solutions for this:

  1. Use Outlook via RSS
  2. Write a simple list-based workflow
  3. Use a 3rd-party tool

I’m going to focus this on #2 for this blog.  In case you are interested on the other options, here is one example for using Outlook.  It involves creating a view that just shows the items based on a date filter, then you get an RSS feed to the list view, add that to Oultook and configure some rules to trigger the alert.  It’s fine for one person, but not when you for a large group of users.  There are multiple 3rd-party tools that allow you to customize or augment the out of the box alert emails, as well as also send reminder emails.  Here are some links to a few:

So we’re going to setup a simple workflow to do the trick for us.  Personally I think it’s way overkill and I don’t like using workflows for this, but this is just to show that you can do this out of the box.  You will need a calendar already created, and SharePoint Designer installed on your computer.  If you don’t have those 2 things, take care of that and I’ll be here when you go back.  Go ahead, I’ll wait.

Done yet?  Now there are many many ways to do the workflow, and what I will show you is just one.  I’m going to show you a way without creating any additional calculated columns, and just do it all in the workflow.  Let’s knock this out.

Requirements

In our example, these are our requirements for this workflow:

  • The person who created the calendar item should get an email under the following conditions:
    • If the item is created more than 2 days before the start time of the calendar event, send a reminder 2 days before the start time
    • If the item is created within 2 days of the start of the event, send an email immediately (content similar to above)
    • If the item is created after the start of the event, don’t send an email
  • Additional details on the email:
    • A specific named person should be on the CC
    • 2 days does not have to take any special times or days of week into account, just 24 hours before
    • The email should contain most of the properties of the calendar item
      • when showing the Start Time, show it in a nice full format (like Monday, July 15th 2014 3:00 PM)
  • Start conditions
    • Start on item created
    • Don’t start if item is just updated
      • in this case, provide obvious easy way for the user to manually start the reminder to regenerate the reminder

Steps

Create the Workflow

  1. Open your site in SharePoint Designer, and go to your list. Under Workflows, click New.  Call it Due Reminder (or whatever you like), and give a description.
    image
  2. It will open a new empty workflow.  Click the Local Variables button, and create 3 new variables (you’ll see why later):
    1. Reminder Date – date/time
    2. LongStartDateTime – String
    3. LongEndDateTime – StringSNAGHTMLa416971
  3. Rename the Step to Set Variables.
  4. We need to calculate the time that the email should be sent (2 days before the start time of the event).  We will calculate this date value, and store it in a variable.
    1. Type “add” and hit enter, and choose “Add Time to Date”.  Make it look like the following.  When you choose date, click the formula symbolimage, then choose the Start Time field in the Field to choose drop down.
      image
  5. Click on Local Variables again, highlight the variable date, and click Remove.  We don’t need it.
  6. We need to set a couple more variables.  Inside the email when we show the start and end time, by default will show like 7/14/2014 3:00 AM.  If this is fine, then you can skip this step.  I wanted to show it in a more full format.  To do that, we need to concatenate two formats together, and store them in a variable we can use later in the email.
    1. Below the first action, type “set workflow”, and choose “Set Workflow Variable”.  For the variable choose LongStartDateTime, and for the value, this time click the ellipse (3 dots icon image).  In the window, click Add or Change Lookup, pick Start Time for the field, and choose Long Date for “Return Field as”.  Then click Add or Change Lookup again, and again choose Start Time, but return that field as Short Time.
    2. Add another set workflow variable action as above.  This time use the variable named LongEndDateTime, and use the field End Time instead.You should end with something like this:
      image
  7. This is optional, but I like to do it.  We can dump out the values of the variables so we can see them when we run the workflow.  Add one other action below the variables, type “log” and choose Log to workflow history.  Click this message, then the 3 dots, and type some text like a label for the variable, then click Add or change lookup, and for the data source choose Workflow variables, and insert your 3 variables, like so:
    image
  8. Click your cursor completely below the first Step box, and click Step under Insert on the ribbon, and rename it (right-click) and call it Send Reminders.  It should not appear INSIDE your Set variables step.
    image
  9. Now we need to build the conditions under which to send or not send the emails.  Type “if current” and hit Enter.  For field, choose Created, is less than or equal to, the variable ReminderDate.
  10. Add 3 other conditions as indicated in the screenshot:
    1. Pause until ReminderDate
    2. Email
    3. stop workflow – type something in the message meaningful like “2 day reminder email sent, stopping”imageFor the email, this can be whatever you like, but this is what I entered.  I made the Title hyperlink to the Current Item URL, and the blurred text is the name of the team site, hyperlinked to Current Site URL.  To hyperlink, highlight the object, then click the link button on the right next to Automatic.  To choose those, click Workflow Context for the data source, then Current Site or Current Item URL.
      image
  11. For the rest, follow similar steps.  To create the else if, click under the IF, and choose Else If on the ribbon, then type another IF.  This time, use If created in a specific date span.
    image
  12. Complete the 2nd and 3rd options as indicated below.  The above option si for when the user creates an entry before the reminder time, so the workflow will pause till the reminder time.  If the user creates between the reminder and start time, it will use the 2nd workflow action.  Otherwise, it will use the last option and not send an email at all.
    image
  13. Click Save on the ribbon.  Click on Due Reminder on the path at the top, and click the option Start workflow automatically when an item is created.
  14. Click Publish.

Create the Custom Actions

The hard part is done, now we need to meet the easy to use requirements.  What happens when a user edits the start time of an item?  The workflow won’t run, so we need the user to manually start the workflow.  That is not so intuitive for users, so we want to create some buttons to make it easier for users. We do that by creating Custom Actions, which are buttons either on the ribbon or list item menu in the interface that will go directly to the start this workflow page.  We want it in 3 places:

  • View  Ribbon
    image
  • List Item Menu
    image
  • Display form Ribbon
    image

Back in SharePoint Designer, open the Calendar list.  At the bottom right, you will see an option that says Custom Actions.  Don’t click the New to the right of it on the page, use the Custom Action off the ribbon at the top.  Insert 3 custom actions with the following properties.

  1. View Ribbon
    1. Name = Start Calendar Reminder
    2. Action = start Due Reminder workflow
    3. Button Image URL 16×16 = /_layouts/images/WKFLW16.PNG
    4. Button Image URL 32×32 =  /_layouts/images/SocialTag_32x32.png
    5. Ribbon location = Ribbon.Calendar.Events.Actions.Controls._children
  2. List Item Menu
    1. Name = Start Calendar Reminder
    2. Action = start Due Reminder workflow
    3. Button Image URL 16×16 = /_layouts/images/WKFLW16.PNG
  3. Display form Ribbon
    1. Name = Start Calendar Reminder
    2. Action = start Due Reminder workflow
    3. Button Image URL 16×16 = /_layouts/images/WKFLW16.PNG
    4. Button Image URL 32×32 =  /_layouts/images/SocialTag_32x32.png
    5. Ribbon location = Ribbon.ListForm.Display.Actions.Controls._childrenimage

Done!  Test it out, and everything should work.  Again, these are suggestions, but you can change this up to be anything you like.  I used F12 in IE to figure out the correct Ribbon location for the View Ribbon, and searched on the SharePoint server to use the same images it uses for workflow or the metadata tagging.

– See more at:

  • http://blogs.c5insight.com/Home/entryid/490/Best-Practice-to-Create-a-Simple-Time-Based-Email-Reminder-for-SharePoint-Calendar-Events#sthash.Y385LSGv.dpuf
  • http://blogs.c5insight.com/Home/entryid/490/Best-Practice-to-Create-a-Simple-Time-Based-Email-Reminder-for-SharePoint-Calendar-Events
Share

Comments are closed.