1
0

notification_mailer_preview.rb 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. # Preview all emails at http://localhost:3000/rails/mailers/notification_mailer
  2. class NotificationMailerPreview < ActionMailer::Preview
  3. # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/mention
  4. def mention
  5. m = Mention.last
  6. NotificationMailer.mention(m.account, Notification.find_by(activity: m))
  7. end
  8. # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/follow
  9. def follow
  10. f = Follow.last
  11. NotificationMailer.follow(f.target_account, Notification.find_by(activity: f))
  12. end
  13. # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/favourite
  14. def favourite
  15. f = Favourite.last
  16. NotificationMailer.favourite(f.status.account, Notification.find_by(activity: f))
  17. end
  18. # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/reblog
  19. def reblog
  20. r = Status.where.not(reblog_of_id: nil).first
  21. NotificationMailer.reblog(r.reblog.account, Notification.find_by(activity: r))
  22. end
  23. # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/digest
  24. def digest
  25. NotificationMailer.digest(Account.first, since: 90.days.ago)
  26. end
  27. end