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 --- .../comment_mailer/new_comment_email.html.haml | 22 ++++++++++++++++++++++ .../comment_mailer/new_comment_email.text.erb | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 app/views/comment_mailer/new_comment_email.html.haml create mode 100644 app/views/comment_mailer/new_comment_email.text.erb (limited to 'app/views/comment_mailer') diff --git a/app/views/comment_mailer/new_comment_email.html.haml b/app/views/comment_mailer/new_comment_email.html.haml new file mode 100644 index 0000000..bd9e91c --- /dev/null +++ b/app/views/comment_mailer/new_comment_email.html.haml @@ -0,0 +1,22 @@ +%h1 Four Island +%p + A comment has been posted on + = link_to @comment.blog.title, @comment.blog + by the following user: +%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.published_at.strftime("%B #{@comment.published_at.day.ordinalize}, %Y at %-I:%M:%S%P") +%p= link_to "See the comment on the web", blog_url(@comment.blog, anchor: "comment-#{@comment.id}") diff --git a/app/views/comment_mailer/new_comment_email.text.erb b/app/views/comment_mailer/new_comment_email.text.erb new file mode 100644 index 0000000..e37046f --- /dev/null +++ b/app/views/comment_mailer/new_comment_email.text.erb @@ -0,0 +1,20 @@ +Four Island +=========== + +A comment has been posted on <%= @comment.blog.title %> by the following user: + +* Name: <%= @comment.username %> +* Email: <%= @comment.email %> +<% unless @comment.website.empty? %>* Website: <%= @comment.website %> +<% end %> +Here is the comment: + +--- + +<%= @comment.body %> + +--- + +Posted: <%= @comment.published_at.strftime("%B #{@comment.published_at.day.ordinalize}, %Y at %-I:%M:%S%P") %> + +See the comment on the web: <%= blog_url(@comment.blog, anchor: "comment-#{@comment.id}") %> -- cgit 1.4.1