# 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