10

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?

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.

  • 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. – Vedran Rasol Jul 26 '11 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
    +1 because I like Free/Busy field – Vedran Rasol Sep 21 '11 at 20:24
  • Definitely. A gem hidden in plain sight! It's the main reason I posted this as an answer. – Rich Bennema Sep 21 '11 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.

  • 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 '11 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

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.

protected by Community Jan 16 '13 at 8:48

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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