application_mailer.rb 511 B

12345678910111213141516171819202122232425
  1. # frozen_string_literal: true
  2. class ApplicationMailer < ActionMailer::Base
  3. layout 'mailer'
  4. helper :application
  5. helper :instance
  6. helper :formatting
  7. after_action :set_autoreply_headers!
  8. protected
  9. def locale_for_account(account)
  10. I18n.with_locale(account.user_locale || I18n.default_locale) do
  11. yield
  12. end
  13. end
  14. def set_autoreply_headers!
  15. headers['Precedence'] = 'list'
  16. headers['X-Auto-Response-Suppress'] = 'All'
  17. headers['Auto-Submitted'] = 'auto-generated'
  18. end
  19. end