diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-12 21:51:02 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-12 21:51:02 -0400 |
commit | 9ad3bca2ea475b709c8311ab25194e4578c1a0d9 (patch) | |
tree | b60fa4048784bb36853d461fc6df14579a241534 /app/controllers | |
parent | 2022e18daab968ad49af9b3e59969ef1ed110436 (diff) | |
download | thoughts-9ad3bca2ea475b709c8311ab25194e4578c1a0d9.tar.gz thoughts-9ad3bca2ea475b709c8311ab25194e4578c1a0d9.tar.bz2 thoughts-9ad3bca2ea475b709c8311ab25194e4578c1a0d9.zip |
Webmaster gets an email when a comment is posted
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 |