aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/blog/posts_controller.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb
index ee707ed..1d8a0b5 100644
--- a/app/controllers/blog/posts_controller.rb
+++ b/app/controllers/blog/posts_controller.rb
@@ -17,6 +17,18 @@ class Blog::PostsController < BlogController
def comment
if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid?
+ if BlogComment::Moderation.enabled? or @blog_comment.ham?
+ begin
+ if Rails.version < '3.0.0'
+ Blog::CommentMailer.deliver_notification(@blog_comment, request)
+ else
+ Blog::CommentMailer.notification(@blog_comment, request).deliver
+ end
+ rescue
+ logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n"
+ end
+ end
+
if BlogComment::Moderation.enabled?
flash[:notice] = t('blog.posts.comments.thank_you_moderated')
redirect_to blog_post_url(params[:id])