diff options
author | Jamis Buck <jamis@37signals.com> | 2005-07-01 13:17:44 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-07-01 13:17:44 +0000 |
commit | 5ddffc8c24635fe44cd66f78d7b5e2f7091e34d6 (patch) | |
tree | cffc5827c0d13f359a4b105164ec75df831c3e08 /actionmailer/lib/action_mailer/base.rb | |
parent | 5651a69130acfcfadcf0d0eeafe7e7f5ee5ba17b (diff) | |
download | rails-5ddffc8c24635fe44cd66f78d7b5e2f7091e34d6.tar.gz rails-5ddffc8c24635fe44cd66f78d7b5e2f7091e34d6.tar.bz2 rails-5ddffc8c24635fe44cd66f78d7b5e2f7091e34d6.zip |
Allow for nested parts in multipart mails #1570 [Flurin Egger]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1581 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 919d92670f..9a432faa32 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -1,5 +1,6 @@ require 'action_mailer/adv_attr_accessor' require 'action_mailer/part' +require 'action_mailer/part_container' require 'tmail/net' module ActionMailer #:nodoc: @@ -108,6 +109,7 @@ module ActionMailer #:nodoc: # pick a different charset from inside a method with <tt>@charset</tt>. class Base include ActionMailer::AdvAttrAccessor + include ActionMailer::PartContainer private_class_method :new #:nodoc: @@ -220,25 +222,6 @@ module ActionMailer #:nodoc: return @mail end - # Add a part to a multipart message, with the given content-type. The - # part itself is yielded to the block, so that other properties (charset, - # body, headers, etc.) can be set on it. - def part(params) - params = {:content_type => params} if String === params - part = Part.new(params) - yield part if block_given? - @parts << part - end - - # Add an attachment to a multipart message. This is simply a part with the - # content-disposition set to "attachment". - def attachment(params, &block) - params = { :content_type => params } if String === params - params = { :disposition => "attachment", - :transfer_encoding => "base64" }.merge(params) - part(params, &block) - end - private def render_message(method_name, body) initialize_template_class(body).render_file(method_name) |