JohnSmith
JohnSmith

Reputation: 1268

How to add default headers to each mailer rails 5.2

Is there a way to add default headers to each mailer. I have a helper where I create the header but I still need to call the helper (add_headers) in each mailer seperatly. Any ideas?

Upvotes: 0

Views: 148

Answers (1)

spickermann
spickermann

Reputation: 106812

I would expect that default works for headers too:

class ApplicationMailer
  default headers: { foo: 'bar' }
end

def BazMailer < ApplicationMailer
  # ...
end

Upvotes: 1

Related Questions