PageRenderTime 41ms CodeModel.GetById 23ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/aws/actionmailer/ses_extension.rb

http://github.com/drewblas/aws-ses
Ruby | 19 lines | 9 code | 3 blank | 7 comment | 0 complexity | c15fe1b827c1516042b6f4e3b06bec3e MD5 | raw file
Possible License(s): JSON
 1# A quick little extension to use this lib with with rails 2.3.X
 2# To use it, in your environment.rb or some_environment.rb you simply set
 3#
 4# config.after_initialize do
 5#  ActionMailer::Base.delivery_method = :amazon_ses
 6#  ActionMailer::Base.custom_amazon_ses_mailer = AWS::SES::Base.new(:secret_access_key => S3_CONFIG[:secret_access_key], :access_key_id => S3_CONFIG[:access_key_id])
 7# end
 8            
 9module ActionMailer
10  class Base
11    cattr_accessor :custom_amazon_ses_mailer
12    
13    def perform_delivery_amazon_ses(mail)
14      raise 'AWS::SES::Base has not been intitialized.' unless @@custom_amazon_ses_mailer
15      @@custom_amazon_ses_mailer.deliver!(mail)
16    end
17
18  end
19end