The project needs to study the alert customization of WSS.
There are two methods for customization:
(Method 1) Modify the template file.
The default template is 12 \ template \ XML \ alerttemplates. xml. Copy and modify the template and run the stsadm command to add the template:
Stsadm-O updatealerttemplates-URL
(Method 2) Write a class, implement the ialertpolicyhandler interface, and configure the implementation of this class to the custom alert template. Similarly, you need to use stsadm to add the template.
The advantage of the first method is that you do not need to deal with the specific sending logic. However, since the template declaration adopts a syntax similar to caml, It is very troublesome to modify it and cannot make some logical judgment for copying.
Method 2 requiredCodeTo handle the mail logic, flexible control, but may lose some system template functions (for example, the project modification event notification can display the modified characters, which are newly added ).
For more information, seeArticle:
Http://support.microsoft.com/kb/948321
This article was written by the wss sdk team:
Http://blogs.msdn.com/sharepointdeveloperdocs/archive/2007/12/07/customizing-alert-notifications-and-alert-templates-in-windows-sharepoint-services-3-0.aspx
The above two articles use stsadm to add an alert template. In fact, it is also possible to use code:
String Templatename = " Customtemplate1 " ;
// You can obtain the server template.
Spalerttemplatecollection ATS = New Spalerttemplatecollection (spwebservice )( Base . Getcurrentspsite (). webapplication. Parent ));
// Add or modify a template
Spalerttemplate t = ATS [templatename];
If (T = Null )
T = ATS. Add ();
T. Name = Templatename;
T. xml = Xmldoc. innerxml;
T. Update ();
// You can set a list template separately:
Splist list = Somelist;
List. alerttemplate = ATS [templatename];
// The list trial template must exist in the template set with the server. It cannot be a template object directly.
List. parentweb. allowunsafeupdates = True ;
List. Update ();