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

.Text Comment Notification Email Delivery piece

Nuther piece of my .Text Comment Notification function is email delivery, which as I described before is essentially a manual process, executed when I click a link in the HTML email sent to the blog admin.  That link calls my /blog/admin/DBVTUtils.aspx page (which I described how to add to .Text in this post) and based on the “action” Querystring value, sends out the email to any comment subscribers of the Post.

The code which sends out the email to subscribers is below.  I added the Notification and NotificationCollection objects to .Text  and will describe that and using the .Text data provider in another post.  The response looks like the screenpic at bottom.

private void SendNotification(int postID, int commentID, int userID)
{
 NotificationCollection nc = Notices.GetNotifyList(postID);
 Entry entry = Cacher.SingleEntry(commentID, CacheTime.Short, Context);  
 if (nc != null)
 {
  foreach (Notification n in nc)
  {
   if (n.UserID != userID)
   {
    try
    {
     Dottext.Framework.DBVT.Email.SendNotification(entry, n.Email);
    }
    catch
    { //next
    }
   }
  }
 }
 dgNotification.DataSource = nc;
 dgNotification.DataKeyField = "NoticeID";
 dgNotification.DataBind();
}


 



Comments (0) | Post RSS RSS comment feed

Posted on 9/30/2004 1:06:00 PM by Dave Burke
Categories:
Tags: no tags for this post

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke