Mastodon by Werefox Software source code
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.

notification_mailer.rb 1.2KB

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