the sample works perfect for "immediate" alert. It does not work however (at least for me) when you use it for daily or weekly summaries, and loop through the notifications with ..
SPWeb web = site.OpenWeb(ahp.webId);
SPList list = web.Lists[ahp.a.ListID];
foreach(SPAlertEventData myData in ahp.eventData)
{
if (myData.eventType == 2) // I am just interested in the change events (event type is always set correctly)
{
try
{
SPListItem item = list.GetItemById(myData.itemId);
........
Then go and define a daily alert and change some documents (checkout - change the filename of the document - checkin).
You will notice, that SharePoint somehow messes up the idemID. Instead of an ID that points to a document in the library it returns arbitrary big numbers such as 1936549236 instead of the itemID. Also the eventXML just contains "<fileds>\r\n</fields>" instad of event info.
Again, everything is OK when you just use SPListItem item = list.GetItemById(ahp.eventData[0].itemId) for an immediate alert as in the sample above.
Has anyone a clue whats wrong or can it really be that this is a bug?
Any input highly appreciated
Tom