admin_mailer.rb 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # frozen_string_literal: true
  2. class AdminMailer < ApplicationMailer
  3. layout 'plain_mailer'
  4. helper :accounts
  5. def new_report(recipient, report)
  6. @report = report
  7. @me = recipient
  8. @instance = Rails.configuration.x.local_domain
  9. locale_for_account(@me) do
  10. mail to: @me.user_email, subject: I18n.t('admin_mailer.new_report.subject', instance: @instance, id: @report.id)
  11. end
  12. end
  13. def new_pending_account(recipient, user)
  14. @account = user.account
  15. @me = recipient
  16. @instance = Rails.configuration.x.local_domain
  17. locale_for_account(@me) do
  18. mail to: @me.user_email, subject: I18n.t('admin_mailer.new_pending_account.subject', instance: @instance, username: @account.username)
  19. end
  20. end
  21. def new_trending_tag(recipient, tag)
  22. @tag = tag
  23. @me = recipient
  24. @instance = Rails.configuration.x.local_domain
  25. locale_for_account(@me) do
  26. mail to: @me.user_email, subject: I18n.t('admin_mailer.new_trending_tag.subject', instance: @instance, name: @tag.name)
  27. end
  28. end
  29. end