From 26a7339889929025495df59776d1a33ca19c77ae Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 13 Oct 2023 13:18:18 -0400 Subject: Pending comments also send you an email now --- .../new_pending_comment_email.html.haml | 22 ++++++++++++++++++++++ .../new_pending_comment_email.text.erb | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 app/views/comment_mailer/new_pending_comment_email.html.haml create mode 100644 app/views/comment_mailer/new_pending_comment_email.text.erb (limited to 'app/views') diff --git a/app/views/comment_mailer/new_pending_comment_email.html.haml b/app/views/comment_mailer/new_pending_comment_email.html.haml new file mode 100644 index 0000000..d3f7dca --- /dev/null +++ b/app/views/comment_mailer/new_pending_comment_email.html.haml @@ -0,0 +1,22 @@ +%p + A new comment has been posted on + = link_to @comment.blog.title, @comment.blog + that is pending moderation. +%p The details of the user that posted it: +%ul + %li + Name: + = @comment.username + %li + Email: + = @comment.email + - unless @comment.website.empty? + %li + Website: + = @comment.website +%p Here is the comment: +%blockquote= @comment.body +%p + Posted: + = @comment.created_at.strftime("%B #{@comment.created_at.day.ordinalize}, %Y at %-I:%M:%S%P") +%p= link_to "Go to the admin panel", pending_admin_comments_url diff --git a/app/views/comment_mailer/new_pending_comment_email.text.erb b/app/views/comment_mailer/new_pending_comment_email.text.erb new file mode 100644 index 0000000..787d6b8 --- /dev/null +++ b/app/views/comment_mailer/new_pending_comment_email.text.erb @@ -0,0 +1,19 @@ +A comment has been posted on <%= @comment.blog.title %> that is pending moderation. + +The details of the user that posted it: + +* Name: <%= @comment.username %> +* Email: <%= @comment.email %> +<% unless @comment.website.empty? %>* Website: <%= @comment.website %> +<% end %> +Here is the comment: + +--- + +<%= @comment.body %> + +--- + +Posted: <%= @comment.created_at.strftime("%B #{@comment.created_at.day.ordinalize}, %Y at %-I:%M:%S%P") %> + +Go to the admin panel: <%= pending_admin_comments_url %> -- cgit 1.4.1