Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Changeset [f4f76772fb5c25357a54baaa9cd20f7e9a1cd653] by Matthew Rudy Jacobs

Revision f4f76772fb5c25357a54baaa9cd20f7e9a1cd653, committed 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...

11 changed files

  • 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