diff options
author | Philip Arndt <parndt@gmail.com> | 2010-11-15 17:39:33 +1300 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2010-11-15 17:39:52 +1300 |
commit | 5b55dc2f375cac1a78bc70150a9473a74271ffdd (patch) | |
tree | 6e8c3320ec2cbe40644390c79a776738eb572542 /app/controllers/blog/posts_controller.rb | |
parent | 426c0d913f62de7377d5b7dd3172f2e7117cfaec (diff) | |
download | refinerycms-blog-5b55dc2f375cac1a78bc70150a9473a74271ffdd.tar.gz refinerycms-blog-5b55dc2f375cac1a78bc70150a9473a74271ffdd.tar.bz2 refinerycms-blog-5b55dc2f375cac1a78bc70150a9473a74271ffdd.zip |
Added comment notifications.
Diffstat (limited to 'app/controllers/blog/posts_controller.rb')
-rw-r--r-- | app/controllers/blog/posts_controller.rb | 12 |
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]) |