From d3da87ce771845f99bbdc04d6d6587b22655b063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim=20and=20Mikel=20Lindsaar?= Date: Thu, 21 Jan 2010 00:10:22 +1100 Subject: Mail method accepting all headers set via the hash --- actionmailer/lib/action_mailer/base.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'actionmailer/lib') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 8825bd35f9..39ddafe7fe 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/class' +require "active_support/core_ext/module/delegation" require 'mail' require 'action_mailer/tmail_compat' @@ -267,7 +268,6 @@ module ActionMailer #:nodoc: include ActionMailer::DeliveryMethods - private_class_method :new #:nodoc: @@raise_delivery_errors = true @@ -355,6 +355,9 @@ module ActionMailer #:nodoc: # Expose the internal Mail message attr_reader :message + # Pass calls to headers and attachment to the Mail#Message instance + delegate :headers, :attachments, :to => :@message + # Alias controller_path to mailer_name so render :partial in views work. alias :controller_path :mailer_name @@ -478,7 +481,6 @@ module ActionMailer #:nodoc: m.cc = quote_address_if_necessary(headers[:cc], m.charset) if headers[:cc] m.bcc = quote_address_if_necessary(headers[:bcc], m.charset) if headers[:bcc] m.reply_to = quote_address_if_necessary(headers[:reply_to], m.charset) if headers[:reply_to] - m.mime_version = headers[:mime_version] if headers[:mime_version] m.date = headers[:date] if headers[:date] m.body.set_sort_order(headers[:parts_order] || @@default_implicit_parts_order) -- cgit v1.2.3