diff options
author | Aaron Patterson <tenderlove@github.com> | 2019-03-01 14:06:41 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-01 14:06:41 -0800 |
commit | ed6364f7b6579a890c5cedc3c9e5b2f8af586e9e (patch) | |
tree | d30267bf589b995579904244316829156d14b5f6 /actionmailer/lib/action_mailer/base.rb | |
parent | 2939c2c0e011347d06ba3cc9dfe4ebe3b08f6799 (diff) | |
parent | bcd42ae974eb04cb5def7a01d194e70b87bc4152 (diff) | |
download | rails-ed6364f7b6579a890c5cedc3c9e5b2f8af586e9e.tar.gz rails-ed6364f7b6579a890c5cedc3c9e5b2f8af586e9e.tar.bz2 rails-ed6364f7b6579a890c5cedc3c9e5b2f8af586e9e.zip |
Merge pull request #35429 from jhawthorn/template_format_nil
Allow nil format on templates
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 52360d40fe..8595b1e063 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -973,10 +973,11 @@ module ActionMailer templates_name = headers[:template_name] || action_name each_template(Array(templates_path), templates_name).map do |template| - self.formats = [template.format] + format = template.format || self.formats.first + self.formats = [format] { body: render(template: template), - content_type: template.type.to_s + content_type: Mime[format].to_s } end end |