Class: Aws::ActionMailer::SESV2::Mailer
- Inherits:
-
Object
- Object
- Aws::ActionMailer::SESV2::Mailer
- Defined in:
- lib/aws/action_mailer/ses_v2/mailer.rb
Overview
Provides a delivery method for ActionMailer that uses Amazon Simple Email Service V2.
Configure a delivery method with:
= { region: 'us-west-2' }
ActionMailer::Base.add_delivery_method :ses_v2, Aws::ActionMailer::SESV2Mailer, **
Client options are used to construct a new Aws::SESV2::Client instance. Once you have a delivery method, you can configure your Rails environment to use it:
config.action_mailer.delivery_method = :ses_v2
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 40 41 42 |
# File 'lib/aws/action_mailer/ses_v2/mailer.rb', line 30 def deliver!() params = { content: { raw: { data: .to_s } } } params[:from_email_address] = from_email_address() params[:destination] = { to_addresses: to_addresses(), cc_addresses: .cc, bcc_addresses: .bcc } @client.send_email(params).tap do |response| .header[:ses_message_id] = response. end end |
#settings ⇒ Hash
45 46 47 |
# File 'lib/aws/action_mailer/ses_v2/mailer.rb', line 45 def settings {} end |