Getting new alerts for a SharePoint user in c#

GaryHelZJk

New Member
I have an ASP.NET 4.0 application that is written in c#. I also have a SP2010 Foundation application that is using Claims Based Authentication.The users do not see the SharePoint application entirely. Only library views are embeded into Iframes and a single sign on has been implemented so that when a user logs in to my application, they are also simultaneously logged into SP. Is it possible to get all alerts for a specific user.For example:Jim logs into my application and sees the following:Doc A has a new modificationDoc C has just been uploaded.Document B has a new modification.So basically instead of sending an e-mail I Would like to use the SP DOM to grab all pending updates for a specific user. Something similar to this:\[code\]SPUser user = web.EnsureUser(@"domainName\userName");SPAlertCollection alertColl = user.Alerts;foreach (SPAlert alert in alertColl){Console.WriteLine(alert.Title); }\[/code\]I am assuming this would give the alerts that a specific user has been assigned to. But does SharePoint store if a user has a new alert for the item that they have alerts assigned?
 
Back
Top