I'm trying to create a custom Alert Notification handler that implements IAlertNotifyHandler
to intercept immediate alerts generated by changed to publishing pages.
I've followed this guide, and also this one. I've also made changes to alerttemplates.xml
in the 14 Hive, and run stsadm -o updatealerttemplates
. I've also iisreset
and made sure alerts are actually being generated by viewing the log file, which says it attempts to send alert emails.
But whatever I do, I can't get my alert notification handler to fire. I've tried both attaching to all the w3wp.exe
processes with the Visual Studio 2010 debugger, and also tried writing to both the SharePoint log and the Windows Event log from within the handler. I get nothing.
This is the XML added for my custom alert notification handler:
<NotificationHandlerAssembly>
MyAssembly, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=...
</NotificationHandlerAssembly>
<NotificationHandlerClassName>
MyAssembly.MyClass
</NotificationHandlerClassName>
<NotificationHandlerProperties></NotificationHandlerProperties>
I've added this to the two built-in alert templates for SPAlertTemplateType.GenericList
and SPAlertTemplateType.WebPageLibrary
.
The class looks like this:
public class MyAlertNotifyHandler : IAlertNotifyHandler {
public bool OnNotification(SPAlertHandlerParams ahp) {
// ...
Does anyone have an idea why this isn't working?