aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/old_api.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-04-12 10:25:02 +0200
committerJosé Valim <jose.valim@gmail.com>2010-04-12 10:25:02 +0200
commitb5f9a9fce316e96ffb9ab3a69e9311f8b1e56fde (patch)
treefaee771eeeb2b7bef358c920e36513d242f0399f /actionmailer/lib/action_mailer/old_api.rb
parente5f392ce8ffe2a7fd3bd920132c4cdba8d207a4a (diff)
downloadrails-b5f9a9fce316e96ffb9ab3a69e9311f8b1e56fde.tar.gz
rails-b5f9a9fce316e96ffb9ab3a69e9311f8b1e56fde.tar.bz2
rails-b5f9a9fce316e96ffb9ab3a69e9311f8b1e56fde.zip
Move set_fields! to the old API module.
Diffstat (limited to 'actionmailer/lib/action_mailer/old_api.rb')
-rw-r--r--actionmailer/lib/action_mailer/old_api.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/old_api.rb b/actionmailer/lib/action_mailer/old_api.rb
index 24c6ec8eda..b2111209c7 100644
--- a/actionmailer/lib/action_mailer/old_api.rb
+++ b/actionmailer/lib/action_mailer/old_api.rb
@@ -143,7 +143,7 @@ module ActionMailer
{ :content_type => content_type,
:content_disposition => content_disposition }.merge(params)
end
-
+
def create_mail
m = @_message
@@ -230,6 +230,17 @@ module ActionMailer
)
end
+ def set_fields!(headers, charset) #:nodoc:
+ m = @_message
+ m.charset = charset
+ m.subject ||= headers.delete(:subject) if headers[:subject]
+ m.to ||= headers.delete(:to) if headers[:to]
+ m.from ||= headers.delete(:from) if headers[:from]
+ m.cc ||= headers.delete(:cc) if headers[:cc]
+ m.bcc ||= headers.delete(:bcc) if headers[:bcc]
+ m.reply_to ||= headers.delete(:reply_to) if headers[:reply_to]
+ end
+
def split_content_type(ct)
ct.to_s.split("/")
end