Created
May 5, 2017 18:11
-
-
Save letmein/c8fa8add83529e7c95d1ee65c7d83f32 to your computer and use it in GitHub Desktop.
spec/support/application_mailer.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
module MailerNameHeader | |
extend ActiveSupport::Concern | |
included do | |
after_action :set_headers | |
end | |
private | |
def set_headers | |
headers['X-Mailer-Name'] = self.class.name | |
end | |
end | |
ApplicationMailer.include(MailerNameHeader) | |
# Ex: mail.header['X-Mailer-Name'].value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment