闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

  1. class NotificationMailer < ApplicationMailer
  2. helper StreamEntriesHelper
  3. def mention(mentioned_account, status)
  4. @me = mentioned_account
  5. @status = status
  6. return unless @me.user.settings(:notification_emails).mention
  7. mail to: @me.user.email, subject: "You were mentioned by #{@status.account.acct}"
  8. end
  9. def follow(followed_account, follower)
  10. @me = followed_account
  11. @account = follower
  12. return unless @me.user.settings(:notification_emails).follow
  13. mail to: @me.user.email, subject: "#{@account.acct} is now following you"
  14. end
  15. def favourite(target_status, from_account)
  16. @me = target_status.account
  17. @account = from_account
  18. @status = target_status
  19. return unless @me.user.settings(:notification_emails).favourite
  20. mail to: @me.user.email, subject: "#{@account.acct} favourited your status"
  21. end
  22. def reblog(target_status, from_account)
  23. @me = target_status.account
  24. @account = from_account
  25. @status = target_status
  26. return unless @me.user.settings(:notification_emails).reblog
  27. mail to: @me.user.email, subject: "#{@account.acct} reblogged your status"
  28. end
  29. end