11

I'd like to have all attendees to be notified via email that they have been invited to an event from a Sharepoint calendar. How can I do this?

5 Answers 5

6

You could create a column for the calendar that is "attendees" that is a people or group type column. Then you can create a very simple workflow that will send an email to those people who are entered. This could be done with SharePoint Designer.

1
  • 4
    Default calendar list already has column Attendees (internal name: ParticipantsPicker). For some reasons beyond my knowledge this column is not attached to default Event content type. Jul 26, 2011 at 22:22
10

Here is my implementation of Vedran's answer:

First, in a feature receiver, I swapped the Event content type with the Schedule content type to take advantage of the Attendees field (and the cool Free/Busy field!):

SPList list = lists["Calendar"];
SPContentType newContentType = 
    list.ContentTypes.Add(list.ParentWeb.ContentTypes[SPBuiltInContentTypeId.Schedule]);
SPContentType oldContentType = list.ContentTypes[0];
string name = oldContentType.Name;
string description = oldContentType.Description;
oldContentType.Delete();
newContentType.Name = name;
newContentType.Description = description;
newContentType.Update();

The form now looks like this:

enter image description here

Second, I added an Event Receiver that sends the notices:

public override void ItemAdded(SPItemEventProperties properties)
{
    SPList list = properties.List;
    SPListItem item = properties.ListItem;
    SPFieldUserValueCollection values = item[SPBuiltInFieldId.ParticipantsPicker] as SPFieldUserValueCollection;

    List<string> emails = new List<string>();
    foreach (SPFieldUserValue value in values)
    {
        SPUser user = value.User;
        if (!string.IsNullOrEmpty(user.Email))
        {
            emails.Add(user.Email);
        }
    }

    if (emails.Count > 0)
    {
        StringDictionary headers = new StringDictionary();
        headers.Add("to", string.Join(";", emails.ToArray()));
        headers.Add("subject", item.Title);
        SPUtility.SendEmail(web, headers, body);
    }
}

It works great.

2
  • 2
    +1 because I like Free/Busy field Sep 21, 2011 at 20:24
  • Definitely. A gem hidden in plain sight! It's the main reason I posted this as an answer. Sep 21, 2011 at 22:40
6

One of solutions is to add new people type column (or use OOTB Attendees column) to calendar for storing meeting attendees.

Then you can write custom event receiver for calendar list that handles email notification(s) according to meeting changes (attendee added, deleted, meeting canceled etc.). This approach is not simple but has some benefits (you can easily redeploy solution to affect other calendars).

I need to point out that SharePoint calendar doesn't provide OOTB function to easily receive auto meeting responses (like eg Exchange). This makes most of the new SharePoint users quite unhappy.

1
  • Thanks. Yes, this was a direct request from a customer, so I am looking into ways of giving a similar function to exchange. It looks like they will have to adapt or keep their old practices.
    – nfw
    Jul 26, 2011 at 22:58
1

When you create the event/meeting you can optionally create a meeting workspace. Within the meeting workspace you can add attendees. Once added, they receive an email notification and from there can choose to accept or decline.

I can give you step-by-step instructions if needed.

EDIT: We had implemented an intranet a couple years back at a former employer and managed our client meetings with workspaces. I thought the emails were sent automatically when the item was added to the Attendees list, but after a closer look it appears someone added a workflow to the Attendees list to send the email when a new Attendee is added to the list. Per Lori's answer you could extend the calendar list with a column and attach a workflow or attach a simple workflow to the Attendees list...either approach would work.

Sorry if this sent you down the wrong path.

0
-1

Since calendars are just lists users can create a User Alert for the list item by using the Alert Me function on just that item/event. This offers an opt-in solution for emails instead of pushing emails out to all attendees. It does, however, rely on the user to perform an action to get the alerts. If this isn't how your events are set to run, then it might not be for you.

Not the answer you're looking for? Browse other questions tagged or ask your own question.