闭社主体 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.

43 lines
1.3 KiB

  1. # frozen_string_literal: true
  2. class NotificationMailer < ApplicationMailer
  3. helper StreamEntriesHelper
  4. def mention(recipient, notification)
  5. @me = recipient
  6. @status = notification.target_status
  7. I18n.with_locale(@me.user.locale || I18n.default_locale) do
  8. mail to: @me.user.email, subject: I18n.t('notification_mailer.mention.subject', name: @status.account.acct)
  9. end
  10. end
  11. def follow(recipient, notification)
  12. @me = recipient
  13. @account = notification.from_account
  14. I18n.with_locale(@me.user.locale || I18n.default_locale) do
  15. mail to: @me.user.email, subject: I18n.t('notification_mailer.follow.subject', name: @account.acct)
  16. end
  17. end
  18. def favourite(recipient, notification)
  19. @me = recipient
  20. @account = notification.from_account
  21. @status = notification.target_status
  22. I18n.with_locale(@me.user.locale || I18n.default_locale) do
  23. mail to: @me.user.email, subject: I18n.t('notification_mailer.favourite.subject', name: @account.acct)
  24. end
  25. end
  26. def reblog(recipient, notification)
  27. @me = recipient
  28. @account = notification.from_account
  29. @status = notification.target_status
  30. I18n.with_locale(@me.user.locale || I18n.default_locale) do
  31. mail to: @me.user.email, subject: I18n.t('notification_mailer.reblog.subject', name: @account.acct)
  32. end
  33. end
  34. end