diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-12-07 10:33:07 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-12-07 10:33:07 -0500 |
commit | 9681897e9ace534c4559fa9be20aa86af1a42e13 (patch) | |
tree | 85fbe155f6d1db7f8e232dac40be109fa066f9ed /app/mailers | |
parent | de217df62df5725450ba7fd0084a00a8ebe24599 (diff) | |
download | thoughts-9681897e9ace534c4559fa9be20aa86af1a42e13.tar.gz thoughts-9681897e9ace534c4559fa9be20aa86af1a42e13.tar.bz2 thoughts-9681897e9ace534c4559fa9be20aa86af1a42e13.zip |
Add daily upvote email like AO3 kudos
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/vote_mailer.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 @@ | |||
1 | class VoteMailer < ApplicationMailer | ||
2 | def daily_report_email | ||
3 | @entries = params[:votes].group_by { |v| "#{v.votable_type}_#{v.votable_id}" }.values | ||
4 | # weird way of getting the admin's email | ||
5 | mail to: User.first.email, subject: "[Four Island] You have upvotes!" | ||
6 | end | ||
7 | end | ||