Build a SharePoint Newsletter Generator That Alerts Users to Changes, Page 2
Security ConsiderationsWhen you set up the example, you must remember to configure proper security. The demonstration opted for an ASP.NET Web site instead of a Web Part, which had some security ramifications. For instance, you would access the SharePoint sites using the account set up with the Application Pool assigned to the ASP.NET Newsletter application. Be sure the account has proper access to the SharePoint sites you will be accessing.
Other options are available for configuring the ASP.NET application. Refer to the SharePoint SDK for more information on impersonation and the other security options.
Extending the NewsletterConsider the following suggestions for extending the demonstration in this article:
- Iterate over all of the Web sites on all of the Virtual Servers using the SPGlobalAdmin class and the SPVirtualServerCollection.
- The application does not navigate into subfolders. You can modify the application to access subfolders using the SubFolders collection in the SPFolder class.
- It would not take much to extend the application to deliver the email message to groups of email addresses. You could even collect the addresses from the users on the site and deliver an email to each user. Collecting user information from SharePoint is straightforward. The SPWeb class contains a collection called "Users". The Users collection contains SPUser classes. SPUser contains a property called Email.
- Using techniques you learned from the Newsletter example, you could build a custom site map for your SharePoint sites.
You'll find other helpful resources on the Web. "SharePoint Products and Technologies Web Component Directory" on the Microsoft Web site contains a number of well documented code samples.
Keep Your SharePoint Users UpdatedUsing the SPWeb, SPSite, and SPFolder classes built into the SharePoint SDK, you can build a newsletter application to keep your users abreast of changes to your SharePoint sites.
Download the Code
To download the accompanying source code for the example, click here.
About the Author
Jeffrey Juday is a software developer with Crowe Chizek in South Bend, Indiana. He has been developing software with Microsoft tools for more than 12 years in a variety of industries. Jeff currently builds solutions using BizTalk 2004, ASP.NET, SharePoint, and SQL Server 2000. You can reach Jeff at email@example.com.