aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/part_container.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@Yehuda-Katz.local>2009-12-25 13:06:11 -0800
committerYehuda Katz <wycats@Yehuda-Katz.local>2009-12-25 13:06:11 -0800
commit8f6da9483b28ec82e4577bf4cbe5209e2c750c84 (patch)
tree4c52a09b3268ff90dae12f8bc525f0b2f3acbace /actionmailer/lib/action_mailer/part_container.rb
parent2e79ec71a542c2d2e7bedbe12eda0b5e177fb0e0 (diff)
parent9f1c359a201bfacff7b89cd1e8579bc1bdf541e2 (diff)
downloadrails-8f6da9483b28ec82e4577bf4cbe5209e2c750c84.tar.gz
rails-8f6da9483b28ec82e4577bf4cbe5209e2c750c84.tar.bz2
rails-8f6da9483b28ec82e4577bf4cbe5209e2c750c84.zip
Merge remote branch 'jose/am'
Diffstat (limited to 'actionmailer/lib/action_mailer/part_container.rb')
-rw-r--r--actionmailer/lib/action_mailer/part_container.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/part_container.rb b/actionmailer/lib/action_mailer/part_container.rb
index abfd8f8426..3fe502b1fb 100644
--- a/actionmailer/lib/action_mailer/part_container.rb
+++ b/actionmailer/lib/action_mailer/part_container.rb
@@ -39,8 +39,24 @@ module ActionMailer
end
private
-
- def parse_content_type(defaults=nil)
+
+ def normalize_new_lines(text) #:nodoc:
+ text.to_s.gsub(/\r\n?/, "\n")
+ end
+
+ def setup_multiple_parts(mailer, real_content_type, ctype_attrs) #:nodoc:
+ @parts.each do |p|
+ part = (TMail::Mail === p ? p : p.to_mail(self))
+ mailer.parts << part
+ end
+
+ if real_content_type =~ /multipart/
+ ctype_attrs.delete "charset"
+ mailer.set_content_type(real_content_type, nil, ctype_attrs)
+ end
+ end
+
+ def parse_content_type(defaults=nil) #:nodoc:
if content_type.blank?
return defaults ?
[ defaults.content_type, { 'charset' => defaults.charset } ] :