lib/action_mailer/base.rb in actionmailer-6.0.0.beta1 vs lib/action_mailer/base.rb in actionmailer-6.0.0.beta2
- old
+ new
@@ -591,19 +591,19 @@
end
private
def set_payload_for_mail(payload, mail)
+ payload[:mail] = mail.encoded
payload[:mailer] = name
payload[:message_id] = mail.message_id
payload[:subject] = mail.subject
payload[:to] = mail.to
payload[:from] = mail.from
payload[:bcc] = mail.bcc if mail.bcc.present?
payload[:cc] = mail.cc if mail.cc.present?
payload[:date] = mail.date
- payload[:mail] = mail.encoded
payload[:perform_deliveries] = mail.perform_deliveries
end
def method_missing(method_name, *args)
if action_methods.include?(method_name.to_s)
@@ -971,11 +971,11 @@
def collect_responses_from_templates(headers)
templates_path = headers[:template_path] || self.class.mailer_name
templates_name = headers[:template_name] || action_name
each_template(Array(templates_path), templates_name).map do |template|
- self.formats = template.formats
+ self.formats = [template.format]
{
body: render(template: template),
content_type: template.type.to_s
}
end
@@ -984,10 +984,10 @@
def each_template(paths, name, &block)
templates = lookup_context.find_all(name, paths)
if templates.empty?
raise ActionView::MissingTemplate.new(paths, name, paths, false, "mailer")
else
- templates.uniq(&:formats).each(&block)
+ templates.uniq(&:format).each(&block)
end
end
def create_parts_from_responses(m, responses)
if responses.size == 1 && !m.has_attachments?