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