about summary refs log tree commit diff stats
path: root/test/mailers/previews
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-12-07 10:33:07 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-12-07 10:33:07 -0500
commit9681897e9ace534c4559fa9be20aa86af1a42e13 (patch)
tree85fbe155f6d1db7f8e232dac40be109fa066f9ed /test/mailers/previews
parentde217df62df5725450ba7fd0084a00a8ebe24599 (diff)
downloadthoughts-9681897e9ace534c4559fa9be20aa86af1a42e13.tar.gz
thoughts-9681897e9ace534c4559fa9be20aa86af1a42e13.tar.bz2
thoughts-9681897e9ace534c4559fa9be20aa86af1a42e13.zip
Add daily upvote email like AO3 kudos
Diffstat (limited to 'test/mailers/previews')
-rw-r--r--test/mailers/previews/vote_mailer_preview.rb11
1 files changed, 11 insertions, 0 deletions
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 @@
1# Preview all emails at http://localhost:3000/rails/mailers/vote_mailer
2class VoteMailerPreview < ActionMailer::Preview
3
4 # Preview this email at http://localhost:3000/rails/mailers/vote_mailer/daily_report_email
5 def daily_report_email
6 # Duplicating logic from the task... love it
7 votes = Vote.where("created_at > ?", 1.day.ago).where(upvote: 1).all
8 VoteMailer.with(votes: votes).daily_report_email
9 end
10
11end