Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Community Server Email Basic Food Group

I needed to create an Email Alert function the other day to send emails to a designated Community Server Role when a certain background task encountered an error.  Posting an event to the CS Event log wasn't good enough for us this time.  In the process of assemblying the custom email function I thought it a good example of the basic ingredients that comprise the Community Server email process.

First we're going to create a new Email Alert template in the \languages\en-US\emails\emails.xml template file.  We've specified both TEXT and HTML versions of the message and will need to populate our tokens, "ErrorType", "InternalExceptionUrl", "ExternalExceptionUrl", etc.  The email will tell us an error has occurred and provide direct links to the site Exception Log.  There's also a "DistributionList" token (in the HTML template) which I like to include in my custom email processes because I think it's useful for each recipient to know who all is receiving the message.


 

 

The background task creates an instance of a custom DBVTEmailsProvider and gets the ball rolling with a populated MailPost object and the role to whom we want to send the email.



 

The Email Provider populates the tokens for each user in the role and places the email message in the Email Queue.  Highlighted is the process of populating the tokens via an EmailHelper class.



Comments (0) | Post RSS RSS comment feed

Posted on 5/3/2008 9:10:00 AM by Dave Burke
Categories: Community Server | Jobs Management App

Related posts

Comments are closed

Copyright © 2008 Dave Burke Consulting  |  All Rights reserved.