SharePoint Products TechCenter >
SharePoint Products and Technologies Forums
>
SharePoint - Development and Programming
>
SharePoint alert handler and zones
SharePoint alert handler and zones
- I have been working on a custom alert handler by following the steps in the following blog: http://blogs.msdn.com/sharepointdeveloperdocs/archive/2007/12/14/how-to-customizing-alert-emails-using-ialertnotificationhandler.aspx (great resource by the way). Anyway everything works as expected until I sub-scribe to an alert in a different zone. For instance I have two zone one that is AD authenticated (default zone) and the other that is froms authenticated. When I setup an alert on the forms zone and recieve the email the link is for the default zone. Now if I setup an alert on a list type that the custom alert handler isn't associated with the link gets sent perfectly.
Any help or insight would be much appreciated.
Thanks
Jeremy
Answers
I was finally able to get something to work, unfortunatly it was not with a custom alert handler like I was trying to do. I ended up creating a copy of the alerttemplates.xml and modifing it to meet our needs. It was a bit more work but it works perfectly.
- Marked As Answer byJeremy Weiss Monday, November 23, 2009 2:17 PM
All Replies
- Hi Jeremy,
When you create the alerts from the forms zone, it means you visit the list in the forms zone, and subscribe the alert there?
In the code do you use the webUrl and sieUrl properties of the SPAlertHandlerParams when constructing the link URL? Have you tried to debug / trace your code?
The step 5 in the referenced article is:
"Run this command from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN: stsadm -o updatealerttemplates -filename "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML\customalerttemplates.xml" -url <your sharepoint site url>"
Have you registered the same alert template for both zone of the site? Probably you shouldn't, but I'm not sure in that. What happens if you register it using the FBA URL instead of the default one?
Peter - Peter thanks for the reply and sorry abou the delay in response. I have subscrived from alerts on both zones and I have using the webUrl and siteUrl properties. I have traced the code and that is when I first noticed it. I have not tried register the customalerttemplate.xml with the forms url. I will give that a shot and post back the results.
- I finally had time to try the suggestion that Peter had about registering on the forms URL. I decided to attach to the timer service and place a watch on the variables and some break points in the code so I could step through the code. Using the immediate windows I started looking through the ahp vaiable and found that url's always point to the default zone (non-forms URL).
I was finally able to get something to work, unfortunatly it was not with a custom alert handler like I was trying to do. I ended up creating a copy of the alerttemplates.xml and modifing it to meet our needs. It was a bit more work but it works perfectly.
- Marked As Answer byJeremy Weiss Monday, November 23, 2009 2:17 PM
Hi Jeremy,
It means that you have no problem with the FBA zone when using this approach?Peter
- Correct, an alert has the proper url on the FBA zone and the proper url on the default zone when using the custom alert template. I'm a little confused why this works, but it works the way I needed it to.

