2016-11-15 10:56:29 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-03-19 14:20:07 -04:00
|
|
|
class ApplicationMailer < ActionMailer::Base
|
|
|
|
layout 'mailer'
|
2018-01-15 21:29:11 -05:00
|
|
|
|
2018-01-28 18:22:20 -05:00
|
|
|
helper :application
|
2017-04-17 18:16:32 -04:00
|
|
|
helper :instance
|
2022-03-25 21:53:34 -04:00
|
|
|
helper :formatting
|
2017-06-26 18:04:00 -04:00
|
|
|
|
2023-03-03 14:44:46 -05:00
|
|
|
after_action :set_autoreply_headers!
|
|
|
|
|
2017-06-26 18:04:00 -04:00
|
|
|
protected
|
|
|
|
|
2023-02-19 21:18:08 -05:00
|
|
|
def locale_for_account(account, &block)
|
2023-12-18 16:49:17 -05:00
|
|
|
I18n.with_locale(account.user_locale || I18n.locale || I18n.default_locale, &block)
|
2017-06-26 18:04:00 -04:00
|
|
|
end
|
2023-03-03 14:44:46 -05:00
|
|
|
|
|
|
|
def set_autoreply_headers!
|
|
|
|
headers['Precedence'] = 'list'
|
|
|
|
headers['X-Auto-Response-Suppress'] = 'All'
|
|
|
|
headers['Auto-Submitted'] = 'auto-generated'
|
|
|
|
end
|
2016-03-19 14:20:07 -04:00
|
|
|
end
|