From fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 14 Oct 2023 11:12:05 -0400 Subject: Added comment replying --- app/controllers/admin/comments_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/controllers/admin') diff --git a/app/controllers/admin/comments_controller.rb b/app/controllers/admin/comments_controller.rb index ccde3e6..9958232 100644 --- a/app/controllers/admin/comments_controller.rb +++ b/app/controllers/admin/comments_controller.rb @@ -14,6 +14,10 @@ class Admin::CommentsController < Admin::AdminController @comment.status = :published @comment.save! + if @comment.reply_to and @comment.reply_to.email != @comment.blog.user.email and @comment.reply_to.email != current_user.email + CommentMailer.with(comment: @comment).reply_comment_email.deliver_later + end + flash.notice = "Comment successfully published." redirect_to pending_admin_comments_url end -- cgit 1.4.1