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