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.

49 lines
1.6 KiB

  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_tags(recipient, tags)
  22. @tags = tags
  23. @me = recipient
  24. @instance = Rails.configuration.x.local_domain
  25. @lowest_trending_tag = Trends.tags.get(true, Trends.tags.options[:review_threshold]).last
  26. locale_for_account(@me) do
  27. mail to: @me.user_email, subject: I18n.t('admin_mailer.new_trending_tags.subject', instance: @instance)
  28. end
  29. end
  30. def new_trending_links(recipient, links)
  31. @links = links
  32. @me = recipient
  33. @instance = Rails.configuration.x.local_domain
  34. @lowest_trending_link = Trends.links.get(true, Trends.links.options[:review_threshold]).last
  35. locale_for_account(@me) do
  36. mail to: @me.user_email, subject: I18n.t('admin_mailer.new_trending_links.subject', instance: @instance)
  37. end
  38. end
  39. end