This project is archived and is in readonly mode.

Changeset [f4f76772fb5c25357a54baaa9cd20f7e9a1cd653] by Matthew Rudy Jacobs

November 1st, 2009 @ 01:23 AM

abstract all of the ActionMailer delivery methods into their own classes. thereby the following are equivalent

ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.delivery_method = ActionMailer::DeliveryMethod::Smtp

we could equally set our own custom object
as long as it provides the instance method :perform_delivery(mail)

eg.

class MySmsDeliveryMethod

def perform_delivery(mail)
  Sms.send(mail['to'], mail['body'])
end

end

MySmsMailer.delivery_method = MySmsDeliveryMethod.new

Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/f4f76772fb5c25357a54baaa9cd20f...

Committed by Matthew Rudy Jacobs

  • A actionmailer/lib/action_mailer/delivery_method.rb
  • A actionmailer/lib/action_mailer/delivery_method/file.rb
  • A actionmailer/lib/action_mailer/delivery_method/sendmail.rb
  • A actionmailer/lib/action_mailer/delivery_method/smtp.rb
  • A actionmailer/lib/action_mailer/delivery_method/test.rb
  • M actionmailer/Rakefile
  • M actionmailer/lib/action_mailer.rb
  • M actionmailer/lib/action_mailer/base.rb
  • M actionmailer/test/delivery_method_test.rb
  • M actionmailer/test/mail_service_test.rb
  • M actionmailer/test/test_helper_test.rb

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>