Class: Aws::ActionMailer::SES::Mailer
- Inherits:
-
Object
- Object
- Aws::ActionMailer::SES::Mailer
- Defined in:
- lib/aws/action_mailer/ses/mailer.rb
Overview
Provides a delivery method for ActionMailer that uses Amazon Simple Email Service.
Configure a delivery method with:
= { region: 'us-west-2' }
ActionMailer::Base.add_delivery_method :ses, Aws::ActionMailer::SESMailer, **
Client options are used to construct a new Aws::SES::Client instance. Once you have a delivery method, you can configure your Rails environment to use it:
config.action_mailer.delivery_method = :ses
Instance Method Summary collapse
-
#deliver!(message) ⇒ Object
Delivers a Mail::Message object.
-
#initialize(options = {}) ⇒ Mailer
constructor
A new instance of Mailer.
- #settings ⇒ Hash
Constructor Details
Instance Method Details
#deliver!(message) ⇒ Object
Delivers a Mail::Message object. Called during mail delivery.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/aws/action_mailer/ses/mailer.rb', line 30 def deliver!() params = { raw_message: { data: .to_s }, source: .smtp_envelope_from, # defaults to From header destinations: .smtp_envelope_to # defaults to destinations (To,Cc,Bcc) } @client.send_raw_email(params).tap do |response| .header[:ses_message_id] = response. end end |
#settings ⇒ Hash
42 43 44 |
# File 'lib/aws/action_mailer/ses/mailer.rb', line 42 def settings {} end |