module AWS::Rails

def self.add_action_mailer_delivery_method name = :amazon_ses, options = {}

Returns:
  • (nil) -

Parameters:
  • options (Hash) -- A hash of options that are passes to
  • name (Symbol) -- (:amazon_ses) The name of the delivery
  • options (Hash) --
def self.add_action_mailer_delivery_method name = :amazon_ses, options = {}
  if ::Rails.version.to_f >= 3
    ActiveSupport.on_load(:action_mailer) do
      self.add_delivery_method(name, AWS::SimpleEmailService, options)
    end
  else
    amb = ::ActionMailer::Base
    amb.send(:define_method, "perform_delivery_#{name}") do |mail|
      AWS::SimpleEmailService.new(options).send_raw_email(mail)
    end
  end
  nil
end