diff --git a/app/mailers/admin_mailer.rb b/app/mailers/admin_mailer.rb index 72a2c2e64..fffbbb3c6 100644 --- a/app/mailers/admin_mailer.rb +++ b/app/mailers/admin_mailer.rb @@ -9,6 +9,8 @@ class AdminMailer < ApplicationMailer before_action :process_params before_action :set_instance + after_action :set_important_headers!, only: :new_critical_software_updates + default to: -> { @me.user_email } def new_report(report) @@ -56,12 +58,6 @@ class AdminMailer < ApplicationMailer def new_critical_software_updates @software_updates = SoftwareUpdate.where(urgent: true).to_a.sort_by(&:gem_version) - headers( - 'Importance' => 'high', - 'Priority' => 'urgent', - 'X-Priority' => '1' - ) - locale_for_account(@me) do mail subject: default_i18n_subject(instance: @instance) end @@ -82,4 +78,12 @@ class AdminMailer < ApplicationMailer def set_instance @instance = Rails.configuration.x.local_domain end + + def set_important_headers! + headers( + 'Importance' => 'high', + 'Priority' => 'urgent', + 'X-Priority' => '1' + ) + end end