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