diff options
Diffstat (limited to 'actionmailer/lib/action_mailer/delivery_method/file.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/delivery_method/file.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/delivery_method/file.rb b/actionmailer/lib/action_mailer/delivery_method/file.rb index 587ae37ffa..571e32df49 100644 --- a/actionmailer/lib/action_mailer/delivery_method/file.rb +++ b/actionmailer/lib/action_mailer/delivery_method/file.rb @@ -6,13 +6,13 @@ module ActionMailer # A delivery method implementation which writes all mails to a file. class File < Method self.settings = { - :location => defined?(Rails) ? "#{Rails.root}/tmp/mails" : "#{Dir.tmpdir}/mails" + :location => defined?(Rails.root) ? "#{Rails.root}/tmp/mails" : "#{Dir.tmpdir}/mails" } def perform_delivery(mail) FileUtils.mkdir_p settings[:location] - (mail.to + mail.cc + mail.bcc).uniq.each do |to| + mail.destinations.uniq.each do |to| ::File.open(::File.join(settings[:location], to), 'a') { |f| f.write(mail) } end end |