Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand

SharePoint 2010 – How Alerts works?

Posted by JP on April 12, 2013


In this article we can explore the underlying infrastructure of SharePoint Alerts. Let us analyze step by step what is happening in the background when we create an alert, alert is triggered, email is sent etc.

What are Alerts?

SharePoint provides an excellent feature which notifies the users on changes of item/library.

Uses can set alerts on:

· Library / List

· Document / Item

You can set alerts through the SharePoint user interface as shown below:

clip_image002

In order to see the above button, you need to set your Email Server in Central Administration > System Settings > Configure outgoing e-mail settings.

clip_image004

clip_image006

For receiving the emails triggered you can use an SharePoint Email Notification Tool like smtp4dev.

Create Alert

Now you are ready to create an alert & we can examine what happens in the database.

clip_image008

Open the database & you can see the following recode in ImmedSubscriptions table.

clip_image010

You can see that the ListId column is assigned with List GUID.

The table structure follows:

clip_image011

clip_image006[1]

You can see database server & name through Central Administration > Manage content databases link.

If you have created a Summary Alert (daily or weekly) you can see the record was created inside SchedSubscriptions table.

The structure of SchedSubscriptions table.

clip_image012


Timer Job

Timer Jobs are responsible for building the Alert using template & sending the Emails. We can see the timer job status through Central Administration > Monitoring > Check job status link.

clip_image014

Scrolling down, you can see the Timer Job for Immediate Alert.

clip_image016

You can see the Status of last execution there. In my case it is succeeded. Click on the link to see the settings as shown below:

clip_image018

In the above case the Timer Job is scheduled to run every 5 minutes. You can try clicking the Run Now button to trigger execution.

Alert Templates

Timer Job creates the email content of through Alert Template file. We can modify the file, but copying & modifying is recommended. We can define template in the list & library level.

The Alert template can be found in 14 hive > TEMPLATE > XML folder.

clip_image020

By default there are 2 templates – one for email & other for sms. The alerttemplates.xml file contains around 10 thousand lines.

We can change the alert template through PowerShell & STSADM commands.

References

http://bit.ly/10uiVpB

Summary

In this article we have explored the activities & tables involved while working with SharePoint Alerts.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s