class Eye::Notify::AWSSDK

Public Instance Methods

execute() click to toggle source
# File lib/eye/notify/awssdk.rb, line 24
def execute
  options = { region: "us-east-1" } # default to us-east-1
  options[:region] = region if region
  options[:credentials] = Aws::Credentials.new(access_key_id, secret_access_key) if access_key_id && secret_access_key
  client = Aws::SES::Client.new(options)
  client.send_email(message)
end
message() click to toggle source
# File lib/eye/notify/awssdk.rb, line 32
def message
  {
    source: from,
    destination: {
      to_addresses: [contact],
    },
    message: {
      subject: {
        data: message_subject,
      },
      body: {
        text: {
          data: message_body,
        },
        html: {
          data: message_body,
        },
      },
    },
  }
end