From 9ad3bca2ea475b709c8311ab25194e4578c1a0d9 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 12 Oct 2023 21:51:02 -0400 Subject: Webmaster gets an email when a comment is posted --- app/mailers/application_mailer.rb | 2 +- app/mailers/comment_mailer.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 app/mailers/comment_mailer.rb (limited to 'app/mailers') diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 286b223..4862159 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,4 +1,4 @@ class ApplicationMailer < ActionMailer::Base - default from: 'from@example.com' + default from: 'no-reply@fourisland.com' layout 'mailer' end diff --git a/app/mailers/comment_mailer.rb b/app/mailers/comment_mailer.rb new file mode 100644 index 0000000..363875a --- /dev/null +++ b/app/mailers/comment_mailer.rb @@ -0,0 +1,7 @@ +class CommentMailer < ApplicationMailer + def new_comment_email + @comment = params[:comment] + @admin = User.first # this is weird + mail(to: @admin.email, subject: "[Four Island] Comment on #{@comment.blog.title}") + end +end -- cgit 1.4.1