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 --- test/mailers/previews/vote_mailer_preview.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/mailers/previews/vote_mailer_preview.rb (limited to 'test/mailers/previews') diff --git a/test/mailers/previews/vote_mailer_preview.rb b/test/mailers/previews/vote_mailer_preview.rb new file mode 100644 index 0000000..dfc5da1 --- /dev/null +++ b/test/mailers/previews/vote_mailer_preview.rb @@ -0,0 +1,11 @@ +# Preview all emails at http://localhost:3000/rails/mailers/vote_mailer +class VoteMailerPreview < ActionMailer::Preview + + # Preview this email at http://localhost:3000/rails/mailers/vote_mailer/daily_report_email + def daily_report_email + # Duplicating logic from the task... love it + votes = Vote.where("created_at > ?", 1.day.ago).where(upvote: 1).all + VoteMailer.with(votes: votes).daily_report_email + end + +end -- cgit 1.4.1