What’s New in SharePoint 2010

In previous versions; by out of the box, alerts are sent only through e-mails, but in SP2010 we can able to send an alert to mobile devices as SMS Message. For that, we have a new property under SPAlert, that indicates whether the alert is delivered as E-mail or as an SMS Message.

By default, alerts can be sent only through e-mail. But we can change that default setting by coding option using the new DeliveryChannels Property of SPAlert class. This DeliveryChannels property specifies the delivery method of the alert.

The following snippet used to set the SMS delivery method to the Alert.

oAlert.DeliveryChannels = SPAlertDeliveryChannels.Sms;

SPAlertDeliveryChannels is the enumerated member, which specifies the method of delivering alerts.

Member Name

Description

Email

Delivery as E-mail
Sms

Delivery as SMS Message

The following example code used to update the SMS delivery method to all the alerts for every user available in the Current website.

SPWeb oWebsite = SPContext.Current.Web;
SPUserCollection collUsers = oWebsite.Users;
    foreach (SPUser oUser in collUsers)
    {
        SPAlertCollection collAlerts = oUser.Alerts;
         foreach (SPAlert oAlert in collAlerts)
         {
             oAlert.DeliveryChannels = SPAlertDeliveryChannels.Sms;
             oAlert.Update();
         }
     }

That’s all for now!! I’ll be back with the post on a new feature in SharePoint 2010.