From c2145462178d2b28135fac38ebbceeaadfa151df Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Mon, 25 Feb 2019 19:33:50 -0800 Subject: Create templates with format=nil --- actionmailer/lib/action_mailer/base.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionmailer') 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 -- cgit v1.2.3