From 97e19e8802f16581c49dfa2350b6d0a626d085c8 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Mar 2023 20:44:46 +0100 Subject: [PATCH] Add mail headers to avoid auto-replies (#23597) --- app/mailers/application_mailer.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index a37682eca..4edcb75f3 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -7,6 +7,8 @@ class ApplicationMailer < ActionMailer::Base helper :instance helper :formatting + after_action :set_autoreply_headers! + protected def locale_for_account(account) @@ -14,4 +16,10 @@ class ApplicationMailer < ActionMailer::Base yield end end + + def set_autoreply_headers! + headers['Precedence'] = 'list' + headers['X-Auto-Response-Suppress'] = 'All' + headers['Auto-Submitted'] = 'auto-generated' + end end