From 9681897e9ace534c4559fa9be20aa86af1a42e13 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 7 Dec 2024 10:33:07 -0500 Subject: Add daily upvote email like AO3 kudos --- app/mailers/vote_mailer.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/mailers/vote_mailer.rb (limited to 'app/mailers/vote_mailer.rb') diff --git a/app/mailers/vote_mailer.rb b/app/mailers/vote_mailer.rb new file mode 100644 index 0000000..77ac3d1 --- /dev/null +++ b/app/mailers/vote_mailer.rb @@ -0,0 +1,7 @@ +class VoteMailer < ApplicationMailer + def daily_report_email + @entries = params[:votes].group_by { |v| "#{v.votable_type}_#{v.votable_id}" }.values + # weird way of getting the admin's email + mail to: User.first.email, subject: "[Four Island] You have upvotes!" + end +end -- cgit 1.4.1