WSS alert (email reminder) Customization

Source: Internet
Author: User

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 ();

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.