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