Compartilhar via


Alerts Overview

Applies to: SharePoint Foundation 2010

Alerts are an e-mail and Short Message Service (SMS) notification service in SharePoint Foundation. Users can create alerts to notify them of changes to list items (item-level alerts), documents, lists (list-level alerts), or document libraries.

Alerts in SharePoint Foundationare quite flexible; when you create an alert you have options such as when to be notified and what kind of changes trigger the alert. You can also select whether the alert for a particular list, item, or library will be sent by e-mail or by SMS message. Users and administrators can manage alerts, and developers can customize alerts.

Alert Filters

When a user creates an alert, the alert definition enables the user to apply predefined filters. For example, the user can create an alert only for items he or she created or last modified. Alerts can also be added for items that appear in certain views.

Note

Only some of the views are available as filters for alerts.

Managing Alerts

You can manage alerts from the Site Settings page.

To view and edit your alerts

  1. At the top of the page, click Welcome username.

  2. On the menu, click My Settings. The Personal Settings page appears.

  3. Click My Alerts.

An administrator can view and delete (but not edit) alerts for any users on a site.

To view or delete alerts

  1. Click Site Actions.

  2. On the menu, click Site Settings. The Site Settings page appears.

  3. Click User Alerts.

After an alert has been created, changes that match the criteria specified in the alert are recorded in an event log. Alerts are generated by a timer job that reads the event log and then sends the alert to the user as e-mail or an SMS message to the user’s mobile telephone.

Customizing Alerts

Developers can modify the alert framework by:

  • Adding or removing buttons from the alert e-mails.

  • Changing the cascading style sheet used to format e-mail alerts. This is particularly useful for sites that want to create a consistent appearance.

  • Changing the latency of "immediate" alerts by adjusting the default timer interval.

  • Override the templates used to create e-mail or SMS alerts, either by creating a new template or by setting the SPList.AlertTemplate property.

  • Creating custom filters by using Collaborative Application Markup Language (CAML) queries in the <filters> element in the alert templates.

  • Programmatically setting or changing the mobile messaging service provider (MSP) that forwards SMS alerts to mobile telephones.

  • Adding custom event handlers that respond when a user creates or modifies an alert. Also, custom handlers that respond to the alert sending event can be created.

  • Programming the alerts framework by using the SharePoint Foundation object model. For more information about how to customize alerts programmatically, see SPAlert.

Alert Templates

SharePoint Foundation includes a set of predefined alert templates. These alert templates are defined in AlertTemplates.xml and AlertTemplates_SMS.xml, which are located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\XML. These files specify the format, contents, and properties used to create alert e-mail and SMS messages from each list type. Developers can customize alerts by modifying a copy of AlertTemplates.xml or AlertTemplates_SMS.xml and then loading the customized alert templates by using the command stsadm -o updatealerttemplates.

Note

Do not modify AlertTemplates.xml or AlertTemplates_SMS.xml. Doing so may result in loss of functionality when upgrading or installing service packs.

Note

You must keep the two template files consistent in all their markups, except the Format element. So, if you make a change to a copy of either AlertTemplates.xml or AlertTemplates_SMS.xml (outside of the Format element), you must make the same change in a copy of the other template file. You must then run the stsadm -o updatealerttemplates operation twice, once each for the two modified files.

See Also

Reference

SPAlert

Concepts

AlertTemplates Schema