Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

The AlertTemplate actually being used when making changes to a Publishing Page in a Pages list in a Publishing Web is the SPAlertTemplateType.DocumentLibrary.

Adding the handler to the properties of this alert template makes the handler run.

Very strange though - I would have thought the Pages list in a Publishing Web would match SPAlertTemplateType.WebPageLibrary.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.