diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/comments_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 60c8f6a..c66365b 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb | |||
@@ -43,6 +43,10 @@ class CommentsController < ApplicationController | |||
43 | 43 | ||
44 | if @comment.save | 44 | if @comment.save |
45 | flash.notice = flash_message | 45 | flash.notice = flash_message |
46 | |||
47 | if @comment.status == :published | ||
48 | CommentMailer.with(comment: @comment).new_comment_email.deliver_later | ||
49 | end | ||
46 | else | 50 | else |
47 | flash.alert = "Error posting comment." | 51 | flash.alert = "Error posting comment." |
48 | end | 52 | end |