Sha256: 0e2438a5768f389602eba9af4d7298dc4c83fc70fcda5cca3b6ea17a89bcd71f

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 KB

Contents

module Fog
  module AWS
    class SES
      class Real

        require 'fog/aws/parsers/ses/send_raw_email'

        # Send a raw email
        #
        # ==== Parameters
        # * RawMessage <~String> - The message to be sent.
        # * Options <~Hash>
        #   * Source <~String> - The sender's email address. Takes precenence over Return-Path if specified in RawMessage
        #   * Destinations <~Array> - All destinations for this email.
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'MessageId'<~String> - Id of message
        #     * 'ResponseMetadata'<~Hash>:
        #       * 'RequestId'<~String> - Id of request
        def send_raw_email(raw_message, options = {})
          params = {}
          if options.has_key?('Destinations')
            params.merge!(AWS.indexed_param('Destinations.member', [*options['Destinations']]))
          end
          if options.has_key?('Source')
            params['Source'] = options['Source']
          end

          request({
            'Action'          => 'SendRawEmail',
            'RawMessage.Data' => Base64.encode64(raw_message).chomp!,
            :parser           => Fog::Parsers::AWS::SES::SendRawEmail.new
          }.merge(params))
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-0.8.2 lib/fog/aws/requests/ses/send_raw_email.rb
fog-0.8.1 lib/fog/aws/requests/ses/send_raw_email.rb
fog-0.8.0 lib/fog/aws/requests/ses/send_raw_email.rb