Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Add mail headers to avoid auto-replies (mastodon#23597)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored Mar 3, 2023
1 parent f94aa70 commit d6679d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ class ApplicationMailer < ActionMailer::Base
helper :instance
helper :formatting

after_action :set_autoreply_headers!

protected

def locale_for_account(account, &block)
I18n.with_locale(account.user_locale || I18n.default_locale, &block)
end

def set_autoreply_headers!
headers['Precedence'] = 'list'
headers['X-Auto-Response-Suppress'] = 'All'
headers['Auto-Submitted'] = 'auto-generated'
end
end

0 comments on commit d6679d1

Please sign in to comment.