admin_mailer.rb 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # frozen_string_literal: true
  2. class AdminMailer < ApplicationMailer
  3. layout 'plain_mailer'
  4. helper :accounts
  5. helper :languages
  6. def new_report(recipient, report)
  7. @report = report
  8. @me = recipient
  9. @instance = Rails.configuration.x.local_domain
  10. locale_for_account(@me) do
  11. mail to: @me.user_email, subject: I18n.t('admin_mailer.new_report.subject', instance: @instance, id: @report.id)
  12. end
  13. end
  14. def new_appeal(recipient, appeal)
  15. @appeal = appeal
  16. @me = recipient
  17. @instance = Rails.configuration.x.local_domain
  18. locale_for_account(@me) do
  19. mail to: @me.user_email, subject: I18n.t('admin_mailer.new_appeal.subject', instance: @instance, username: @appeal.account.username)
  20. end
  21. end
  22. def new_pending_account(recipient, user)
  23. @account = user.account
  24. @me = recipient
  25. @instance = Rails.configuration.x.local_domain
  26. locale_for_account(@me) do
  27. mail to: @me.user_email, subject: I18n.t('admin_mailer.new_pending_account.subject', instance: @instance, username: @account.username)
  28. end
  29. end
  30. def new_trends(recipient, links, tags, statuses)
  31. @links = links
  32. @tags = tags
  33. @statuses = statuses
  34. @me = recipient
  35. @instance = Rails.configuration.x.local_domain
  36. locale_for_account(@me) do
  37. mail to: @me.user_email, subject: I18n.t('admin_mailer.new_trends.subject', instance: @instance)
  38. end
  39. end
  40. end