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

CSBlogs : New Comment Email Function. [Updated] [Updated]

Update: The original post on adding a New Comment Email function written 3 minutes ago is below.  I should have just deleted it, but it was a learning experience.  Just ignore it.  I discovered the "Email me Replies to this Post" radio button in the Post - Advanced Settings panel.  I think I'll set it to "yes" and see what happens.  Geez.

Update Two: There's definitely something squirrelly with the "Email me replies to this post" button.  Nothing being sent and nothing in the email queue.  Maybe a bug?  Maybe this New Comment Mod is a helpful thing to have after all?  Anyway, it works.

I need to talk about my experience migrating from DNN/nGallery/dotText to CS (or as I said on a dbvt.com temporary home page yesterday while the site was down, "it got nastier than the streets of Deadwood in August.")  But first I want to talk about new comment emails that are missing in CSBlogs. 

Or at least I think they are.  I stepped through every line of the PostComment Submit() code and discovered a very sophisticated CS email provider with Queuing, subscriptions, censorship checking, user-based ASCII/HTML formatting, email XML templating and other cool stuff, but I sure as heck didn't find a MailNewCommentToAdmin() method.  So I wrote one.  Below is a sample email I now receive on new comments.

First add the line in bold to your FormComments.cs class.

BlogPostResults result = WeblogPosts.Add(entry, CurrentUser, out postID);
DBVT.Email.SendCommentToAdmin(entry);  // DBVT Added to send comment to Admin

Then add this Email.cs class to your CommunityServerBlogs project.  It is fairly well commented (for my code, that is.)  We're passing the WeblogPost object, will create a SiteSettings object to obtain the SmtpServer and a second WeblogPost object to get the HREF for the parent post using BlogUrls.Instance().Post(parentpost) + "#" + post.PostID.  This gives us a one-click link back to the comment and add a reply.

It was always important for me to use the existing object model of dotText and equally so now with CommunityServer.  This Comment Email piece ain't it, but I depend too much on new comment emails and was desperate.  I'll use the slick CS Email Provider services for the next mod.


 

Comments (5) | Post RSS RSS comment feed

Posted on 3/30/2005 7:26:00 AM by Dave Burke
Categories: Community Server
Tags: no tags for this post

Related posts

Comments (5) -

3/30/2005 1:33:24 PM Permalink

Okay, I should get two copies of this comment now...

daveburke |

3/30/2005 1:36:57 PM Permalink

Testing email of comments with a non-daveburke user

Testguy Jones |

3/30/2005 1:43:21 PM Permalink

Okay, I definitely think something's squirrelly with the "Email me replies" setting.  Nothing in the queue either.

Testguy Jones |

3/31/2005 1:27:14 AM Permalink

Ha - and you call yourself a scientist.

Lover Boy 69 |

3/31/2005 5:43:12 AM Permalink

Its not about self-promotion or professional commendation, its about unselfishly giving back to the CommunityServer developer community, regardless of the personal cost and sacrifice.  And besides, Lover Boy 69, this dreamy little CSBurke SendCommentToAdmin() mod works great!  Without it, I might have actually missed your nasty little remark.

Dave Burke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke