class Aws::Rails::Sesv2Mailer

client instance.
Uses the AWS SDK for Ruby’s credential provider chain when creating an SESV2
config.action_mailer.delivery_method = :sesv2
(e.g. RAILS_ROOT/config/environments/production.rb)
use this for ActionMailer in your environment configuration
Once you have an SESv2 delivery method you can configure Rails to
Service V2.
Provides a delivery method for ActionMailer that uses Amazon Simple Email

def deliver!(message)

correctly. Called during mail delivery.
Rails expects this method to exist, and to handle a Mail::Message object
def deliver!(message)
  params = {
    content: { raw: { data: message.to_s } },
    from_email_address: message.smtp_envelope_from, # defaults to From header
    # defaults to destinations (To,Cc,Bcc) - stick all on bcc to be delivered anyway
    destination: { bcc_addresses: message.smtp_envelope_to }
  }
  @client.send_email(params).tap do |response|
    message.header[:ses_message_id] = response.message_id
  end
end

def initialize(options = {})

Parameters:
  • options (Hash) -- Passes along initialization options to
def initialize(options = {})
  @client = SESV2::Client.new(options)
end

def settings

ActionMailer expects this method to be present and to return a hash.
def settings
  {}
end