You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::SES::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



142
143
144
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 142

def initialize(*args)
  super
end

Instance Method Details

#clone_receipt_rule_set(params = {}) ⇒ Struct

Creates a receipt rule set by cloning an existing one. All receipt rules and configurations are copied to the new receipt rule set and are completely independent of the source rule set.

For information about setting up rule sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: CloneReceiptRuleSet


# The following example creates a receipt rule set by cloning an existing one:

resp = client.clone_receipt_rule_set({
  original_rule_set_name: "RuleSetToClone", 
  rule_set_name: "RuleSetToCreate", 
})

Request syntax with placeholder values


resp = client.clone_receipt_rule_set({
  rule_set_name: "ReceiptRuleSetName", # required
  original_rule_set_name: "ReceiptRuleSetName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the rule set to create. The name must:

    • Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-).

    • Start and end with a letter or number.

    • Contain less than 64 characters.

  • :original_rule_set_name (required, String)

    The name of the rule set to clone.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



197
198
199
200
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 197

def clone_receipt_rule_set(params = {}, options = {})
  req = build_request(:clone_receipt_rule_set, params)
  req.send_request(options)
end

#create_configuration_set(params = {}) ⇒ Struct

Creates a configuration set.

Configuration sets enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Request syntax with placeholder values


resp = client.create_configuration_set({
  configuration_set: { # required
    name: "ConfigurationSetName", # required
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :configuration_set (required, Types::ConfigurationSet)

    A data structure that contains the name of the configuration set.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



231
232
233
234
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 231

def create_configuration_set(params = {}, options = {})
  req = build_request(:create_configuration_set, params)
  req.send_request(options)
end

#create_configuration_set_event_destination(params = {}) ⇒ Struct

Creates a configuration set event destination.

When you create or update an event destination, you must provide one, and only one, destination. The destination can be Amazon CloudWatch, Amazon Kinesis Firehose, or Amazon Simple Notification Service (Amazon SNS).

An event destination is the AWS service to which Amazon SES publishes the email sending events associated with a configuration set. For information about using configuration sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Request syntax with placeholder values


resp = client.create_configuration_set_event_destination({
  configuration_set_name: "ConfigurationSetName", # required
  event_destination: { # required
    name: "EventDestinationName", # required
    enabled: false,
    matching_event_types: ["send"], # required, accepts send, reject, bounce, complaint, delivery, open, click
    kinesis_firehose_destination: {
      iam_role_arn: "AmazonResourceName", # required
      delivery_stream_arn: "AmazonResourceName", # required
    },
    cloud_watch_destination: {
      dimension_configurations: [ # required
        {
          dimension_name: "DimensionName", # required
          dimension_value_source: "messageTag", # required, accepts messageTag, emailHeader, linkTag
          default_dimension_value: "DefaultDimensionValue", # required
        },
      ],
    },
    sns_destination: {
      topic_arn: "AmazonResourceName", # required
    },
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :configuration_set_name (required, String)

    The name of the configuration set to which to apply the event destination.

  • :event_destination (required, Types::EventDestination)

    An object that describes the AWS service to which Amazon SES will publish the email sending events associated with the specified configuration set.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



298
299
300
301
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 298

def create_configuration_set_event_destination(params = {}, options = {})
  req = build_request(:create_configuration_set_event_destination, params)
  req.send_request(options)
end

#create_receipt_filter(params = {}) ⇒ Struct

Creates a new IP address filter.

For information about setting up IP address filters, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: CreateReceiptFilter


# The following example creates a new IP address filter:

resp = client.create_receipt_filter({
  filter: {
    ip_filter: {
      cidr: "1.2.3.4/24", 
      policy: "Allow", 
    }, 
    name: "MyFilter", 
  }, 
})

Request syntax with placeholder values


resp = client.create_receipt_filter({
  filter: { # required
    name: "ReceiptFilterName", # required
    ip_filter: { # required
      policy: "Block", # required, accepts Block, Allow
      cidr: "Cidr", # required
    },
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :filter (required, Types::ReceiptFilter)

    A data structure that describes the IP address filter to create, which consists of a name, an IP address range, and whether to allow or block mail from it.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



352
353
354
355
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 352

def create_receipt_filter(params = {}, options = {})
  req = build_request(:create_receipt_filter, params)
  req.send_request(options)
end

#create_receipt_rule(params = {}) ⇒ Struct

Creates a receipt rule.

For information about setting up receipt rules, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: CreateReceiptRule


# The following example creates a new receipt rule:

resp = client.create_receipt_rule({
  after: "", 
  rule: {
    actions: [
      {
        s3_action: {
          bucket_name: "MyBucket", 
          object_key_prefix: "email", 
        }, 
      }, 
    ], 
    enabled: true, 
    name: "MyRule", 
    scan_enabled: true, 
    tls_policy: "Optional", 
  }, 
  rule_set_name: "MyRuleSet", 
})

Request syntax with placeholder values


resp = client.create_receipt_rule({
  rule_set_name: "ReceiptRuleSetName", # required
  after: "ReceiptRuleName",
  rule: { # required
    name: "ReceiptRuleName", # required
    enabled: false,
    tls_policy: "Require", # accepts Require, Optional
    recipients: ["Recipient"],
    actions: [
      {
        s3_action: {
          topic_arn: "AmazonResourceName",
          bucket_name: "S3BucketName", # required
          object_key_prefix: "S3KeyPrefix",
          kms_key_arn: "AmazonResourceName",
        },
        bounce_action: {
          topic_arn: "AmazonResourceName",
          smtp_reply_code: "BounceSmtpReplyCode", # required
          status_code: "BounceStatusCode",
          message: "BounceMessage", # required
          sender: "Address", # required
        },
        workmail_action: {
          topic_arn: "AmazonResourceName",
          organization_arn: "AmazonResourceName", # required
        },
        lambda_action: {
          topic_arn: "AmazonResourceName",
          function_arn: "AmazonResourceName", # required
          invocation_type: "Event", # accepts Event, RequestResponse
        },
        stop_action: {
          scope: "RuleSet", # required, accepts RuleSet
          topic_arn: "AmazonResourceName",
        },
        add_header_action: {
          header_name: "HeaderName", # required
          header_value: "HeaderValue", # required
        },
        sns_action: {
          topic_arn: "AmazonResourceName", # required
          encoding: "UTF-8", # accepts UTF-8, Base64
        },
      },
    ],
    scan_enabled: false,
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the rule set to which to add the rule.

  • :after (String)

    The name of an existing rule after which the new rule will be placed. If this parameter is null, the new rule will be inserted at the beginning of the rule list.

  • :rule (required, Types::ReceiptRule)

    A data structure that contains the specified rule's name, actions, recipients, domains, enabled status, scan status, and TLS policy.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



462
463
464
465
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 462

def create_receipt_rule(params = {}, options = {})
  req = build_request(:create_receipt_rule, params)
  req.send_request(options)
end

#create_receipt_rule_set(params = {}) ⇒ Struct

Creates an empty receipt rule set.

For information about setting up receipt rule sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: CreateReceiptRuleSet


# The following example creates an empty receipt rule set:

resp = client.create_receipt_rule_set({
  rule_set_name: "MyRuleSet", 
})

Request syntax with placeholder values


resp = client.create_receipt_rule_set({
  rule_set_name: "ReceiptRuleSetName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the rule set to create. The name must:

    • Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-).

    • Start and end with a letter or number.

    • Contain less than 64 characters.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



509
510
511
512
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 509

def create_receipt_rule_set(params = {}, options = {})
  req = build_request(:create_receipt_rule_set, params)
  req.send_request(options)
end

#delete_configuration_set(params = {}) ⇒ Struct

Deletes a configuration set.

Configuration sets enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Request syntax with placeholder values


resp = client.delete_configuration_set({
  configuration_set_name: "ConfigurationSetName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :configuration_set_name (required, String)

    The name of the configuration set to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



541
542
543
544
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 541

def delete_configuration_set(params = {}, options = {})
  req = build_request(:delete_configuration_set, params)
  req.send_request(options)
end

#delete_configuration_set_event_destination(params = {}) ⇒ Struct

Deletes a configuration set event destination.

Configuration set event destinations are associated with configuration sets, which enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Request syntax with placeholder values


resp = client.delete_configuration_set_event_destination({
  configuration_set_name: "ConfigurationSetName", # required
  event_destination_name: "EventDestinationName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :configuration_set_name (required, String)

    The name of the configuration set from which to delete the event destination.

  • :event_destination_name (required, String)

    The name of the event destination to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



579
580
581
582
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 579

def delete_configuration_set_event_destination(params = {}, options = {})
  req = build_request(:delete_configuration_set_event_destination, params)
  req.send_request(options)
end

#delete_identity(params = {}) ⇒ Struct

Deletes the specified identity (an email address or a domain) from the list of verified identities.

This action is throttled at one request per second.

Examples:

Example: DeleteIdentity


# The following example deletes an identity from the list of identities that have been submitted for verification with Amazon SES:

resp = client.delete_identity({
  identity: "user@example.com", 
})

Request syntax with placeholder values


resp = client.delete_identity({
  identity: "Identity", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The identity to be removed from the list of identities for the AWS Account.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



614
615
616
617
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 614

def delete_identity(params = {}, options = {})
  req = build_request(:delete_identity, params)
  req.send_request(options)
end

#delete_identity_policy(params = {}) ⇒ Struct

Deletes the specified sending authorization policy for the given identity (an email address or a domain). This API returns successfully even if a policy with the specified name does not exist.

This API is for the identity owner only. If you have not verified the identity, this API will return an error.

Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: DeleteIdentityPolicy


# The following example deletes a sending authorization policy for an identity:

resp = client.delete_identity_policy({
  identity: "user@example.com", 
  policy_name: "MyPolicy", 
})

Request syntax with placeholder values


resp = client.delete_identity_policy({
  identity: "Identity", # required
  policy_name: "PolicyName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The identity that is associated with the policy that you want to delete. You can specify the identity by using its name or by using its Amazon Resource Name (ARN). Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com.

    To successfully call this API, you must own the identity.

  • :policy_name (required, String)

    The name of the policy to be deleted.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



673
674
675
676
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 673

def delete_identity_policy(params = {}, options = {})
  req = build_request(:delete_identity_policy, params)
  req.send_request(options)
end

#delete_receipt_filter(params = {}) ⇒ Struct

Deletes the specified IP address filter.

For information about managing IP address filters, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: DeleteReceiptFilter


# The following example deletes an IP address filter:

resp = client.delete_receipt_filter({
  filter_name: "MyFilter", 
})

Request syntax with placeholder values


resp = client.delete_receipt_filter({
  filter_name: "ReceiptFilterName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :filter_name (required, String)

    The name of the IP address filter to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



713
714
715
716
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 713

def delete_receipt_filter(params = {}, options = {})
  req = build_request(:delete_receipt_filter, params)
  req.send_request(options)
end

#delete_receipt_rule(params = {}) ⇒ Struct

Deletes the specified receipt rule.

For information about managing receipt rules, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: DeleteReceiptRule


# The following example deletes a receipt rule:

resp = client.delete_receipt_rule({
  rule_name: "MyRule", 
  rule_set_name: "MyRuleSet", 
})

Request syntax with placeholder values


resp = client.delete_receipt_rule({
  rule_set_name: "ReceiptRuleSetName", # required
  rule_name: "ReceiptRuleName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the receipt rule set that contains the receipt rule to delete.

  • :rule_name (required, String)

    The name of the receipt rule to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



759
760
761
762
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 759

def delete_receipt_rule(params = {}, options = {})
  req = build_request(:delete_receipt_rule, params)
  req.send_request(options)
end

#delete_receipt_rule_set(params = {}) ⇒ Struct

Deletes the specified receipt rule set and all of the receipt rules it contains.

The currently active rule set cannot be deleted.

For information about managing receipt rule sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: DeleteReceiptRuleSet


# The following example deletes a receipt rule set:

resp = client.delete_receipt_rule_set({
  rule_set_name: "MyRuleSet", 
})

Request syntax with placeholder values


resp = client.delete_receipt_rule_set({
  rule_set_name: "ReceiptRuleSetName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the receipt rule set to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



804
805
806
807
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 804

def delete_receipt_rule_set(params = {}, options = {})
  req = build_request(:delete_receipt_rule_set, params)
  req.send_request(options)
end

#delete_verified_email_address(params = {}) ⇒ Struct

Deletes the specified email address from the list of verified addresses.

The DeleteVerifiedEmailAddress action is deprecated as of the May 15, 2012 release of Domain Verification. The DeleteIdentity action is now preferred.

This action is throttled at one request per second.

Examples:

Example: DeleteVerifiedEmailAddress


# The following example deletes an email address from the list of identities that have been submitted for verification with Amazon SES:

resp = client.delete_verified_email_address({
  email_address: "user@example.com", 
})

Request syntax with placeholder values


resp = client.delete_verified_email_address({
  email_address: "Address", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :email_address (required, String)

    An email address to be removed from the list of verified addresses.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



842
843
844
845
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 842

def delete_verified_email_address(params = {}, options = {})
  req = build_request(:delete_verified_email_address, params)
  req.send_request(options)
end

#describe_active_receipt_rule_set(params = {}) ⇒ Types::DescribeActiveReceiptRuleSetResponse

Returns the metadata and receipt rules for the receipt rule set that is currently active.

For information about setting up receipt rule sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: DescribeActiveReceiptRuleSet


# The following example returns the metadata and receipt rules for the receipt rule set that is currently active:

resp = client.describe_active_receipt_rule_set({
})

resp.to_h outputs the following:
{
  metadata: {
    created_timestamp: Time.parse("2016-07-15T16:25:59.607Z"), 
    name: "default-rule-set", 
  }, 
  rules: [
    {
      actions: [
        {
          s3_action: {
            bucket_name: "MyBucket", 
            object_key_prefix: "email", 
          }, 
        }, 
      ], 
      enabled: true, 
      name: "MyRule", 
      scan_enabled: true, 
      tls_policy: "Optional", 
    }, 
  ], 
}

Response structure


resp..name #=> String
resp..created_timestamp #=> Time
resp.rules #=> Array
resp.rules[0].name #=> String
resp.rules[0].enabled #=> Boolean
resp.rules[0].tls_policy #=> String, one of "Require", "Optional"
resp.rules[0].recipients #=> Array
resp.rules[0].recipients[0] #=> String
resp.rules[0].actions #=> Array
resp.rules[0].actions[0].s3_action.topic_arn #=> String
resp.rules[0].actions[0].s3_action.bucket_name #=> String
resp.rules[0].actions[0].s3_action.object_key_prefix #=> String
resp.rules[0].actions[0].s3_action.kms_key_arn #=> String
resp.rules[0].actions[0].bounce_action.topic_arn #=> String
resp.rules[0].actions[0].bounce_action.smtp_reply_code #=> String
resp.rules[0].actions[0].bounce_action.status_code #=> String
resp.rules[0].actions[0].bounce_action.message #=> String
resp.rules[0].actions[0].bounce_action.sender #=> String
resp.rules[0].actions[0].workmail_action.topic_arn #=> String
resp.rules[0].actions[0].workmail_action.organization_arn #=> String
resp.rules[0].actions[0].lambda_action.topic_arn #=> String
resp.rules[0].actions[0].lambda_action.function_arn #=> String
resp.rules[0].actions[0].lambda_action.invocation_type #=> String, one of "Event", "RequestResponse"
resp.rules[0].actions[0].stop_action.scope #=> String, one of "RuleSet"
resp.rules[0].actions[0].stop_action.topic_arn #=> String
resp.rules[0].actions[0].add_header_action.header_name #=> String
resp.rules[0].actions[0].add_header_action.header_value #=> String
resp.rules[0].actions[0].sns_action.topic_arn #=> String
resp.rules[0].actions[0].sns_action.encoding #=> String, one of "UTF-8", "Base64"
resp.rules[0].scan_enabled #=> Boolean

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Returns:

See Also:



933
934
935
936
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 933

def describe_active_receipt_rule_set(params = {}, options = {})
  req = build_request(:describe_active_receipt_rule_set, params)
  req.send_request(options)
end

#describe_configuration_set(params = {}) ⇒ Types::DescribeConfigurationSetResponse

Returns the details of the specified configuration set.

Configuration sets enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Request syntax with placeholder values


resp = client.describe_configuration_set({
  configuration_set_name: "ConfigurationSetName", # required
  configuration_set_attribute_names: ["eventDestinations"], # accepts eventDestinations
})

Response structure


resp.configuration_set.name #=> String
resp.event_destinations #=> Array
resp.event_destinations[0].name #=> String
resp.event_destinations[0].enabled #=> Boolean
resp.event_destinations[0].matching_event_types #=> Array
resp.event_destinations[0].matching_event_types[0] #=> String, one of "send", "reject", "bounce", "complaint", "delivery", "open", "click"
resp.event_destinations[0].kinesis_firehose_destination.iam_role_arn #=> String
resp.event_destinations[0].kinesis_firehose_destination.delivery_stream_arn #=> String
resp.event_destinations[0].cloud_watch_destination.dimension_configurations #=> Array
resp.event_destinations[0].cloud_watch_destination.dimension_configurations[0].dimension_name #=> String
resp.event_destinations[0].cloud_watch_destination.dimension_configurations[0].dimension_value_source #=> String, one of "messageTag", "emailHeader", "linkTag"
resp.event_destinations[0].cloud_watch_destination.dimension_configurations[0].default_dimension_value #=> String
resp.event_destinations[0].sns_destination.topic_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :configuration_set_name (required, String)

    The name of the configuration set to describe.

  • :configuration_set_attribute_names (Array<String>)

    A list of configuration set attributes to return.

Returns:

See Also:



988
989
990
991
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 988

def describe_configuration_set(params = {}, options = {})
  req = build_request(:describe_configuration_set, params)
  req.send_request(options)
end

#describe_receipt_rule(params = {}) ⇒ Types::DescribeReceiptRuleResponse

Returns the details of the specified receipt rule.

For information about setting up receipt rules, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: DescribeReceiptRule


# The following example returns the details of a receipt rule:

resp = client.describe_receipt_rule({
  rule_name: "MyRule", 
  rule_set_name: "MyRuleSet", 
})

resp.to_h outputs the following:
{
  rule: {
    actions: [
      {
        s3_action: {
          bucket_name: "MyBucket", 
          object_key_prefix: "email", 
        }, 
      }, 
    ], 
    enabled: true, 
    name: "MyRule", 
    scan_enabled: true, 
    tls_policy: "Optional", 
  }, 
}

Request syntax with placeholder values


resp = client.describe_receipt_rule({
  rule_set_name: "ReceiptRuleSetName", # required
  rule_name: "ReceiptRuleName", # required
})

Response structure


resp.rule.name #=> String
resp.rule.enabled #=> Boolean
resp.rule.tls_policy #=> String, one of "Require", "Optional"
resp.rule.recipients #=> Array
resp.rule.recipients[0] #=> String
resp.rule.actions #=> Array
resp.rule.actions[0].s3_action.topic_arn #=> String
resp.rule.actions[0].s3_action.bucket_name #=> String
resp.rule.actions[0].s3_action.object_key_prefix #=> String
resp.rule.actions[0].s3_action.kms_key_arn #=> String
resp.rule.actions[0].bounce_action.topic_arn #=> String
resp.rule.actions[0].bounce_action.smtp_reply_code #=> String
resp.rule.actions[0].bounce_action.status_code #=> String
resp.rule.actions[0].bounce_action.message #=> String
resp.rule.actions[0].bounce_action.sender #=> String
resp.rule.actions[0].workmail_action.topic_arn #=> String
resp.rule.actions[0].workmail_action.organization_arn #=> String
resp.rule.actions[0].lambda_action.topic_arn #=> String
resp.rule.actions[0].lambda_action.function_arn #=> String
resp.rule.actions[0].lambda_action.invocation_type #=> String, one of "Event", "RequestResponse"
resp.rule.actions[0].stop_action.scope #=> String, one of "RuleSet"
resp.rule.actions[0].stop_action.topic_arn #=> String
resp.rule.actions[0].add_header_action.header_name #=> String
resp.rule.actions[0].add_header_action.header_value #=> String
resp.rule.actions[0].sns_action.topic_arn #=> String
resp.rule.actions[0].sns_action.encoding #=> String, one of "UTF-8", "Base64"
resp.rule.scan_enabled #=> Boolean

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the receipt rule set to which the receipt rule belongs.

  • :rule_name (required, String)

    The name of the receipt rule.

Returns:

See Also:



1083
1084
1085
1086
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1083

def describe_receipt_rule(params = {}, options = {})
  req = build_request(:describe_receipt_rule, params)
  req.send_request(options)
end

#describe_receipt_rule_set(params = {}) ⇒ Types::DescribeReceiptRuleSetResponse

Returns the details of the specified receipt rule set.

For information about managing receipt rule sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: DescribeReceiptRuleSet


# The following example returns the metadata and receipt rules of a receipt rule set:

resp = client.describe_receipt_rule_set({
  rule_set_name: "MyRuleSet", 
})

resp.to_h outputs the following:
{
  metadata: {
    created_timestamp: Time.parse("2016-07-15T16:25:59.607Z"), 
    name: "MyRuleSet", 
  }, 
  rules: [
    {
      actions: [
        {
          s3_action: {
            bucket_name: "MyBucket", 
            object_key_prefix: "email", 
          }, 
        }, 
      ], 
      enabled: true, 
      name: "MyRule", 
      scan_enabled: true, 
      tls_policy: "Optional", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_receipt_rule_set({
  rule_set_name: "ReceiptRuleSetName", # required
})

Response structure


resp..name #=> String
resp..created_timestamp #=> Time
resp.rules #=> Array
resp.rules[0].name #=> String
resp.rules[0].enabled #=> Boolean
resp.rules[0].tls_policy #=> String, one of "Require", "Optional"
resp.rules[0].recipients #=> Array
resp.rules[0].recipients[0] #=> String
resp.rules[0].actions #=> Array
resp.rules[0].actions[0].s3_action.topic_arn #=> String
resp.rules[0].actions[0].s3_action.bucket_name #=> String
resp.rules[0].actions[0].s3_action.object_key_prefix #=> String
resp.rules[0].actions[0].s3_action.kms_key_arn #=> String
resp.rules[0].actions[0].bounce_action.topic_arn #=> String
resp.rules[0].actions[0].bounce_action.smtp_reply_code #=> String
resp.rules[0].actions[0].bounce_action.status_code #=> String
resp.rules[0].actions[0].bounce_action.message #=> String
resp.rules[0].actions[0].bounce_action.sender #=> String
resp.rules[0].actions[0].workmail_action.topic_arn #=> String
resp.rules[0].actions[0].workmail_action.organization_arn #=> String
resp.rules[0].actions[0].lambda_action.topic_arn #=> String
resp.rules[0].actions[0].lambda_action.function_arn #=> String
resp.rules[0].actions[0].lambda_action.invocation_type #=> String, one of "Event", "RequestResponse"
resp.rules[0].actions[0].stop_action.scope #=> String, one of "RuleSet"
resp.rules[0].actions[0].stop_action.topic_arn #=> String
resp.rules[0].actions[0].add_header_action.header_name #=> String
resp.rules[0].actions[0].add_header_action.header_value #=> String
resp.rules[0].actions[0].sns_action.topic_arn #=> String
resp.rules[0].actions[0].sns_action.encoding #=> String, one of "UTF-8", "Base64"
resp.rules[0].scan_enabled #=> Boolean

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the receipt rule set to describe.

Returns:

See Also:



1183
1184
1185
1186
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1183

def describe_receipt_rule_set(params = {}, options = {})
  req = build_request(:describe_receipt_rule_set, params)
  req.send_request(options)
end

#get_identity_dkim_attributes(params = {}) ⇒ Types::GetIdentityDkimAttributesResponse

Returns the current status of Easy DKIM signing for an entity. For domain name identities, this action also returns the DKIM tokens that are required for Easy DKIM signing, and whether Amazon SES has successfully verified that these tokens have been published.

This action takes a list of identities as input and returns the following information for each:

  • Whether Easy DKIM signing is enabled or disabled.

  • A set of DKIM tokens that represent the identity. If the identity is an email address, the tokens represent the domain of that address.

  • Whether Amazon SES has successfully verified the DKIM tokens published in the domain's DNS. This information is only returned for domain name identities, not for email addresses.

This action is throttled at one request per second and can only get DKIM attributes for up to 100 identities at a time.

For more information about creating DNS records using DKIM tokens, go to the Amazon SES Developer Guide.

Examples:

Example: GetIdentityDkimAttributes


# The following example retrieves the Amazon SES Easy DKIM attributes for a list of identities:

resp = client.get_identity_dkim_attributes({
  identities: [
    "example.com", 
    "user@example.com", 
  ], 
})

resp.to_h outputs the following:
{
  dkim_attributes: {
    "example.com" => {
      dkim_enabled: true, 
      dkim_tokens: [
        "EXAMPLEjcs5xoyqytjsotsijas7236gr", 
        "EXAMPLEjr76cvoc6mysspnioorxsn6ep", 
        "EXAMPLEkbmkqkhlm2lyz77ppkulerm4k", 
      ], 
      dkim_verification_status: "Success", 
    }, 
    "user@example.com" => {
      dkim_enabled: false, 
      dkim_verification_status: "NotStarted", 
    }, 
  }, 
}

Request syntax with placeholder values


resp = client.get_identity_dkim_attributes({
  identities: ["Identity"], # required
})

Response structure


resp.dkim_attributes #=> Hash
resp.dkim_attributes["Identity"].dkim_enabled #=> Boolean
resp.dkim_attributes["Identity"].dkim_verification_status #=> String, one of "Pending", "Success", "Failed", "TemporaryFailure", "NotStarted"
resp.dkim_attributes["Identity"].dkim_tokens #=> Array
resp.dkim_attributes["Identity"].dkim_tokens[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identities (required, Array<String>)

    A list of one or more verified identities - email addresses, domains, or both.

Returns:

See Also:



1272
1273
1274
1275
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1272

def get_identity_dkim_attributes(params = {}, options = {})
  req = build_request(:get_identity_dkim_attributes, params)
  req.send_request(options)
end

#get_identity_mail_from_domain_attributes(params = {}) ⇒ Types::GetIdentityMailFromDomainAttributesResponse

Returns the custom MAIL FROM attributes for a list of identities (email addresses and/or domains).

This action is throttled at one request per second and can only get custom MAIL FROM attributes for up to 100 identities at a time.

Examples:

Example: GetIdentityMailFromDomainAttributes


# The following example returns the custom MAIL FROM attributes for an identity:

resp = client.get_identity_mail_from_domain_attributes({
  identities: [
    "example.com", 
  ], 
})

resp.to_h outputs the following:
{
  mail_from_domain_attributes: {
    "example.com" => {
      behavior_on_mx_failure: "UseDefaultValue", 
      mail_from_domain: "bounces.example.com", 
      mail_from_domain_status: "Success", 
    }, 
  }, 
}

Request syntax with placeholder values


resp = client.get_identity_mail_from_domain_attributes({
  identities: ["Identity"], # required
})

Response structure


resp.mail_from_domain_attributes #=> Hash
resp.mail_from_domain_attributes["Identity"].mail_from_domain #=> String
resp.mail_from_domain_attributes["Identity"].mail_from_domain_status #=> String, one of "Pending", "Success", "Failed", "TemporaryFailure"
resp.mail_from_domain_attributes["Identity"].behavior_on_mx_failure #=> String, one of "UseDefaultValue", "RejectMessage"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identities (required, Array<String>)

    A list of one or more identities.

Returns:

See Also:



1329
1330
1331
1332
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1329

def get_identity_mail_from_domain_attributes(params = {}, options = {})
  req = build_request(:get_identity_mail_from_domain_attributes, params)
  req.send_request(options)
end

#get_identity_notification_attributes(params = {}) ⇒ Types::GetIdentityNotificationAttributesResponse

Given a list of verified identities (email addresses and/or domains), returns a structure describing identity notification attributes.

This action is throttled at one request per second and can only get notification attributes for up to 100 identities at a time.

For more information about using notifications with Amazon SES, see the Amazon SES Developer Guide.

Examples:

Example: GetIdentityNotificationAttributes


# The following example returns the notification attributes for an identity:

resp = client.get_identity_notification_attributes({
  identities: [
    "example.com", 
  ], 
})

resp.to_h outputs the following:
{
  notification_attributes: {
    "example.com" => {
      bounce_topic: "arn:aws:sns:us-east-1:EXAMPLE65304:ExampleTopic", 
      complaint_topic: "arn:aws:sns:us-east-1:EXAMPLE65304:ExampleTopic", 
      delivery_topic: "arn:aws:sns:us-east-1:EXAMPLE65304:ExampleTopic", 
      forwarding_enabled: true, 
      headers_in_bounce_notifications_enabled: false, 
      headers_in_complaint_notifications_enabled: false, 
      headers_in_delivery_notifications_enabled: false, 
    }, 
  }, 
}

Request syntax with placeholder values


resp = client.get_identity_notification_attributes({
  identities: ["Identity"], # required
})

Response structure


resp.notification_attributes #=> Hash
resp.notification_attributes["Identity"].bounce_topic #=> String
resp.notification_attributes["Identity"].complaint_topic #=> String
resp.notification_attributes["Identity"].delivery_topic #=> String
resp.notification_attributes["Identity"].forwarding_enabled #=> Boolean
resp.notification_attributes["Identity"].headers_in_bounce_notifications_enabled #=> Boolean
resp.notification_attributes["Identity"].headers_in_complaint_notifications_enabled #=> Boolean
resp.notification_attributes["Identity"].headers_in_delivery_notifications_enabled #=> Boolean

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identities (required, Array<String>)

    A list of one or more identities. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com.

Returns:

See Also:



1404
1405
1406
1407
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1404

def get_identity_notification_attributes(params = {}, options = {})
  req = build_request(:get_identity_notification_attributes, params)
  req.send_request(options)
end

#get_identity_policies(params = {}) ⇒ Types::GetIdentityPoliciesResponse

Returns the requested sending authorization policies for the given identity (an email address or a domain). The policies are returned as a map of policy names to policy contents. You can retrieve a maximum of 20 policies at a time.

This API is for the identity owner only. If you have not verified the identity, this API will return an error.

Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: GetIdentityPolicies


# The following example returns a sending authorization policy for an identity:

resp = client.get_identity_policies({
  identity: "example.com", 
  policy_names: [
    "MyPolicy", 
  ], 
})

resp.to_h outputs the following:
{
  policies: {
    "MyPolicy" => "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Sid\":\"stmt1469123904194\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:root\"},\"Action\":[\"ses:SendEmail\",\"ses:SendRawEmail\"],\"Resource\":\"arn:aws:ses:us-east-1:EXAMPLE65304:identity/example.com\"}]}", 
  }, 
}

Request syntax with placeholder values


resp = client.get_identity_policies({
  identity: "Identity", # required
  policy_names: ["PolicyName"], # required
})

Response structure


resp.policies #=> Hash
resp.policies["PolicyName"] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The identity for which the policies will be retrieved. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com.

    To successfully call this API, you must own the identity.

  • :policy_names (required, Array<String>)

    A list of the names of policies to be retrieved. You can retrieve a maximum of 20 policies at a time. If you do not know the names of the policies that are attached to the identity, you can use ListIdentityPolicies.

Returns:

See Also:



1482
1483
1484
1485
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1482

def get_identity_policies(params = {}, options = {})
  req = build_request(:get_identity_policies, params)
  req.send_request(options)
end

#get_identity_verification_attributes(params = {}) ⇒ Types::GetIdentityVerificationAttributesResponse

Given a list of identities (email addresses and/or domains), returns the verification status and (for domain identities) the verification token for each identity.

The verification status of an email address is "Pending" until the email address owner clicks the link within the verification email that Amazon SES sent to that address. If the email address owner clicks the link within 24 hours, the verification status of the email address changes to "Success". If the link is not clicked within 24 hours, the verification status changes to "Failed." In that case, if you still want to verify the email address, you must restart the verification process from the beginning.

For domain identities, the domain's verification status is "Pending" as Amazon SES searches for the required TXT record in the DNS settings of the domain. When Amazon SES detects the record, the domain's verification status changes to "Success". If Amazon SES is unable to detect the record within 72 hours, the domain's verification status changes to "Failed." In that case, if you still want to verify the domain, you must restart the verification process from the beginning.

This action is throttled at one request per second and can only get verification attributes for up to 100 identities at a time.

Examples:

Example: GetIdentityVerificationAttributes


# The following example returns the verification status and the verification token for a domain identity:

resp = client.get_identity_verification_attributes({
  identities: [
    "example.com", 
  ], 
})

resp.to_h outputs the following:
{
  verification_attributes: {
    "example.com" => {
      verification_status: "Success", 
      verification_token: "EXAMPLE3VYb9EDI2nTOQRi/Tf6MI/6bD6THIGiP1MVY=", 
    }, 
  }, 
}

Request syntax with placeholder values


resp = client.get_identity_verification_attributes({
  identities: ["Identity"], # required
})

Response structure


resp.verification_attributes #=> Hash
resp.verification_attributes["Identity"].verification_status #=> String, one of "Pending", "Success", "Failed", "TemporaryFailure", "NotStarted"
resp.verification_attributes["Identity"].verification_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identities (required, Array<String>)

    A list of identities.

Returns:

See Also:



1556
1557
1558
1559
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1556

def get_identity_verification_attributes(params = {}, options = {})
  req = build_request(:get_identity_verification_attributes, params)
  req.send_request(options)
end

#get_send_quota(params = {}) ⇒ Types::GetSendQuotaResponse

Returns the user's current sending limits.

This action is throttled at one request per second.

Examples:

Example: GetSendQuota


# The following example returns the Amazon SES sending limits for an AWS account:

resp = client.get_send_quota({
})

resp.to_h outputs the following:
{
  max_24_hour_send: 200, 
  max_send_rate: 1, 
  sent_last_24_hours: 1, 
}

Response structure


resp.max_24_hour_send #=> Float
resp.max_send_rate #=> Float
resp.sent_last_24_hours #=> Float

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Returns:

See Also:



1596
1597
1598
1599
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1596

def get_send_quota(params = {}, options = {})
  req = build_request(:get_send_quota, params)
  req.send_request(options)
end

#get_send_statistics(params = {}) ⇒ Types::GetSendStatisticsResponse

Returns the user's sending statistics. The result is a list of data points, representing the last two weeks of sending activity.

Each data point in the list contains statistics for a 15-minute interval.

This action is throttled at one request per second.

Examples:

Example: GetSendStatistics


# The following example returns Amazon SES sending statistics:

resp = client.get_send_statistics({
})

resp.to_h outputs the following:
{
  send_data_points: [
    {
      bounces: 0, 
      complaints: 0, 
      delivery_attempts: 5, 
      rejects: 0, 
      timestamp: Time.parse("2016-07-13T22:43:00Z"), 
    }, 
    {
      bounces: 0, 
      complaints: 0, 
      delivery_attempts: 3, 
      rejects: 0, 
      timestamp: Time.parse("2016-07-13T23:13:00Z"), 
    }, 
    {
      bounces: 0, 
      complaints: 0, 
      delivery_attempts: 1, 
      rejects: 0, 
      timestamp: Time.parse("2016-07-13T21:13:00Z"), 
    }, 
  ], 
}

Response structure


resp.send_data_points #=> Array
resp.send_data_points[0].timestamp #=> Time
resp.send_data_points[0].delivery_attempts #=> Integer
resp.send_data_points[0].bounces #=> Integer
resp.send_data_points[0].complaints #=> Integer
resp.send_data_points[0].rejects #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Returns:

See Also:



1661
1662
1663
1664
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1661

def get_send_statistics(params = {}, options = {})
  req = build_request(:get_send_statistics, params)
  req.send_request(options)
end

#list_configuration_sets(params = {}) ⇒ Types::ListConfigurationSetsResponse

Lists the configuration sets associated with your AWS account.

Configuration sets enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second and can return up to 50 configuration sets at a time.

Examples:

Request syntax with placeholder values


resp = client.list_configuration_sets({
  next_token: "NextToken",
  max_items: 1,
})

Response structure


resp.configuration_sets #=> Array
resp.configuration_sets[0].name #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (String)

    A token returned from a previous call to ListConfigurationSets to indicate the position of the configuration set in the configuration set list.

  • :max_items (Integer)

    The number of configuration sets to return.

Returns:

See Also:



1709
1710
1711
1712
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1709

def list_configuration_sets(params = {}, options = {})
  req = build_request(:list_configuration_sets, params)
  req.send_request(options)
end

#list_identities(params = {}) ⇒ Types::ListIdentitiesResponse

Returns a list containing all of the identities (email addresses and domains) for your AWS account, regardless of verification status.

This action is throttled at one request per second.

Examples:

Example: ListIdentities


# The following example lists the email address identities that have been submitted for verification with Amazon SES:

resp = client.list_identities({
  identity_type: "EmailAddress", 
  max_items: 123, 
  next_token: "", 
})

resp.to_h outputs the following:
{
  identities: [
    "user@example.com", 
  ], 
  next_token: "", 
}

Request syntax with placeholder values


resp = client.list_identities({
  identity_type: "EmailAddress", # accepts EmailAddress, Domain
  next_token: "NextToken",
  max_items: 1,
})

Response structure


resp.identities #=> Array
resp.identities[0] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_type (String)

    The type of the identities to list. Possible values are "EmailAddress" and "Domain". If this parameter is omitted, then all identities will be listed.

  • :next_token (String)

    The token to use for pagination.

  • :max_items (Integer)

    The maximum number of identities per page. Possible values are 1-1000 inclusive.

Returns:

See Also:



1773
1774
1775
1776
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1773

def list_identities(params = {}, options = {})
  req = build_request(:list_identities, params)
  req.send_request(options)
end

#list_identity_policies(params = {}) ⇒ Types::ListIdentityPoliciesResponse

Returns a list of sending authorization policies that are attached to the given identity (an email address or a domain). This API returns only a list. If you want the actual policy content, you can use GetIdentityPolicies.

This API is for the identity owner only. If you have not verified the identity, this API will return an error.

Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: ListIdentityPolicies


# The following example returns a list of sending authorization policies that are attached to an identity:

resp = client.list_identity_policies({
  identity: "example.com", 
})

resp.to_h outputs the following:
{
  policy_names: [
    "MyPolicy", 
  ], 
}

Request syntax with placeholder values


resp = client.list_identity_policies({
  identity: "Identity", # required
})

Response structure


resp.policy_names #=> Array
resp.policy_names[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The identity that is associated with the policy for which the policies will be listed. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com.

    To successfully call this API, you must own the identity.

Returns:

See Also:



1842
1843
1844
1845
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1842

def list_identity_policies(params = {}, options = {})
  req = build_request(:list_identity_policies, params)
  req.send_request(options)
end

#list_receipt_filters(params = {}) ⇒ Types::ListReceiptFiltersResponse

Lists the IP address filters associated with your AWS account.

For information about managing IP address filters, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: ListReceiptFilters


# The following example lists the IP address filters that are associated with an AWS account:

resp = client.list_receipt_filters({
})

resp.to_h outputs the following:
{
  filters: [
    {
      ip_filter: {
        cidr: "1.2.3.4/24", 
        policy: "Block", 
      }, 
      name: "MyFilter", 
    }, 
  ], 
}

Response structure


resp.filters #=> Array
resp.filters[0].name #=> String
resp.filters[0].ip_filter.policy #=> String, one of "Block", "Allow"
resp.filters[0].ip_filter.cidr #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Returns:

See Also:



1894
1895
1896
1897
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1894

def list_receipt_filters(params = {}, options = {})
  req = build_request(:list_receipt_filters, params)
  req.send_request(options)
end

#list_receipt_rule_sets(params = {}) ⇒ Types::ListReceiptRuleSetsResponse

Lists the receipt rule sets that exist under your AWS account. If there are additional receipt rule sets to be retrieved, you will receive a NextToken that you can provide to the next call to ListReceiptRuleSets to retrieve the additional entries.

For information about managing receipt rule sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: ListReceiptRuleSets


# The following example lists the receipt rule sets that exist under an AWS account:

resp = client.list_receipt_rule_sets({
  next_token: "", 
})

resp.to_h outputs the following:
{
  next_token: "", 
  rule_sets: [
    {
      created_timestamp: Time.parse("2016-07-15T16:25:59.607Z"), 
      name: "MyRuleSet", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.list_receipt_rule_sets({
  next_token: "NextToken",
})

Response structure


resp.rule_sets #=> Array
resp.rule_sets[0].name #=> String
resp.rule_sets[0].created_timestamp #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (String)

    A token returned from a previous call to ListReceiptRuleSets to indicate the position in the receipt rule set list.

Returns:

See Also:



1959
1960
1961
1962
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 1959

def list_receipt_rule_sets(params = {}, options = {})
  req = build_request(:list_receipt_rule_sets, params)
  req.send_request(options)
end

#list_verified_email_addresses(params = {}) ⇒ Types::ListVerifiedEmailAddressesResponse

Returns a list containing all of the email addresses that have been verified.

The ListVerifiedEmailAddresses action is deprecated as of the May 15, 2012 release of Domain Verification. The ListIdentities action is now preferred.

This action is throttled at one request per second.

Examples:

Example: ListVerifiedEmailAddresses


# The following example lists all email addresses that have been submitted for verification with Amazon SES:

resp = client.list_verified_email_addresses({
})

resp.to_h outputs the following:
{
  verified_email_addresses: [
    "user1@example.com", 
    "user2@example.com", 
  ], 
}

Response structure


resp.verified_email_addresses #=> Array
resp.verified_email_addresses[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Returns:

See Also:



2002
2003
2004
2005
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2002

def list_verified_email_addresses(params = {}, options = {})
  req = build_request(:list_verified_email_addresses, params)
  req.send_request(options)
end

#put_identity_policy(params = {}) ⇒ Struct

Adds or updates a sending authorization policy for the specified identity (an email address or a domain).

This API is for the identity owner only. If you have not verified the identity, this API will return an error.

Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: PutIdentityPolicy


# The following example adds a sending authorization policy to an identity:

resp = client.put_identity_policy({
  identity: "example.com", 
  policy: "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Sid\":\"stmt1469123904194\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:root\"},\"Action\":[\"ses:SendEmail\",\"ses:SendRawEmail\"],\"Resource\":\"arn:aws:ses:us-east-1:EXAMPLE65304:identity/example.com\"}]}", 
  policy_name: "MyPolicy", 
})

Request syntax with placeholder values


resp = client.put_identity_policy({
  identity: "Identity", # required
  policy_name: "PolicyName", # required
  policy: "Policy", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The identity to which the policy will apply. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com.

    To successfully call this API, you must own the identity.

  • :policy_name (required, String)

    The name of the policy.

    The policy name cannot exceed 64 characters and can only include alphanumeric characters, dashes, and underscores.

  • :policy (required, String)

    The text of the policy in JSON format. The policy cannot exceed 4 KB.

    For information about the syntax of sending authorization policies, see the Amazon SES Developer Guide.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2074
2075
2076
2077
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2074

def put_identity_policy(params = {}, options = {})
  req = build_request(:put_identity_policy, params)
  req.send_request(options)
end

#reorder_receipt_rule_set(params = {}) ⇒ Struct

Reorders the receipt rules within a receipt rule set.

All of the rules in the rule set must be represented in this request. That is, this API will return an error if the reorder request doesn't explicitly position all of the rules.

For information about managing receipt rule sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: ReorderReceiptRuleSet


# The following example reorders the receipt rules within a receipt rule set:

resp = client.reorder_receipt_rule_set({
  rule_names: [
    "MyRule", 
    "MyOtherRule", 
  ], 
  rule_set_name: "MyRuleSet", 
})

Request syntax with placeholder values


resp = client.reorder_receipt_rule_set({
  rule_set_name: "ReceiptRuleSetName", # required
  rule_names: ["ReceiptRuleName"], # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the receipt rule set to reorder.

  • :rule_names (required, Array<String>)

    A list of the specified receipt rule set's receipt rules in the order that you want to put them.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2129
2130
2131
2132
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2129

def reorder_receipt_rule_set(params = {}, options = {})
  req = build_request(:reorder_receipt_rule_set, params)
  req.send_request(options)
end

#send_bounce(params = {}) ⇒ Types::SendBounceResponse

Generates and sends a bounce message to the sender of an email you received through Amazon SES. You can only use this API on an email up to 24 hours after you receive it.

You cannot use this API to send generic bounces for mail that was not received by Amazon SES.

For information about receiving email through Amazon SES, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Request syntax with placeholder values


resp = client.send_bounce({
  original_message_id: "MessageId", # required
  bounce_sender: "Address", # required
  explanation: "Explanation",
  message_dsn: {
    reporting_mta: "ReportingMta", # required
    arrival_date: Time.now,
    extension_fields: [
      {
        name: "ExtensionFieldName", # required
        value: "ExtensionFieldValue", # required
      },
    ],
  },
  bounced_recipient_info_list: [ # required
    {
      recipient: "Address", # required
      recipient_arn: "AmazonResourceName",
      bounce_type: "DoesNotExist", # accepts DoesNotExist, MessageTooLarge, ExceededQuota, ContentRejected, Undefined, TemporaryFailure
      recipient_dsn_fields: {
        final_recipient: "Address",
        action: "failed", # required, accepts failed, delayed, delivered, relayed, expanded
        remote_mta: "RemoteMta",
        status: "DsnStatus", # required
        diagnostic_code: "DiagnosticCode",
        last_attempt_date: Time.now,
        extension_fields: [
          {
            name: "ExtensionFieldName", # required
            value: "ExtensionFieldValue", # required
          },
        ],
      },
    },
  ],
  bounce_sender_arn: "AmazonResourceName",
})

Response structure


resp.message_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :original_message_id (required, String)

    The message ID of the message to be bounced.

  • :bounce_sender (required, String)

    The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.

  • :explanation (String)

    Human-readable text for the bounce message to explain the failure. If not specified, the text will be auto-generated based on the bounced recipient information.

  • :message_dsn (Types::MessageDsn)

    Message-related DSN fields. If not specified, Amazon SES will choose the values.

  • :bounced_recipient_info_list (required, Array<Types::BouncedRecipientInfo>)

    A list of recipients of the bounced message, including the information required to create the Delivery Status Notifications (DSNs) for the recipients. You must specify at least one BouncedRecipientInfo in the list.

  • :bounce_sender_arn (String)

    This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the address in the "From" header of the bounce. For more information about sending authorization, see the Amazon SES Developer Guide.

Returns:

See Also:



2237
2238
2239
2240
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2237

def send_bounce(params = {}, options = {})
  req = build_request(:send_bounce, params)
  req.send_request(options)
end

#send_email(params = {}) ⇒ Types::SendEmailResponse

Composes an email message based on input data, and then immediately queues the message for sending.

There are several important points to know about SendEmail:

  • You can only send email from verified email addresses and domains; otherwise, you will get an "Email address not verified" error. If your account is still in the Amazon SES sandbox, you must also verify every recipient email address except for the recipients provided by the Amazon SES mailbox simulator. For more information, go to the Amazon SES Developer Guide.

  • The total size of the message cannot exceed 10 MB. This includes any attachments that are part of the message.

  • You must provide at least one recipient email address. The recipient address can be a To: address, a CC: address, or a BCC: address. If any email address you provide is invalid, Amazon SES rejects the entire email.

  • Amazon SES has a limit on the total number of recipients per message. The combined number of To:, CC: and BCC: email addresses cannot exceed 50. If you need to send an email message to a larger audience, you can divide your recipient list into groups of 50 or fewer, and then call Amazon SES repeatedly to send the message to each group.

  • For every message that you send, the total number of recipients (To:, CC: and BCC:) is counted against your sending quota - the maximum number of emails you can send in a 24-hour period. For information about your sending quota, go to the Amazon SES Developer Guide.

Examples:

Example: SendEmail


# The following example sends a formatted email:

resp = client.send_email({
  destination: {
    bcc_addresses: [
    ], 
    cc_addresses: [
      "recipient3@example.com", 
    ], 
    to_addresses: [
      "recipient1@example.com", 
      "recipient2@example.com", 
    ], 
  }, 
  message: {
    body: {
      html: {
        charset: "UTF-8", 
        data: "This message body contains HTML formatting. It can, for example, contain links like this one: <a class=\"ulink\" href=\"http://docs.aws.amazon.com/ses/latest/DeveloperGuide\" target=\"_blank\">Amazon SES Developer Guide</a>.", 
      }, 
      text: {
        charset: "UTF-8", 
        data: "This is the message body in text format.", 
      }, 
    }, 
    subject: {
      charset: "UTF-8", 
      data: "Test email", 
    }, 
  }, 
  reply_to_addresses: [
  ], 
  return_path: "", 
  return_path_arn: "", 
  source: "sender@example.com", 
  source_arn: "", 
})

resp.to_h outputs the following:
{
  message_id: "EXAMPLE78603177f-7a5433e7-8edb-42ae-af10-f0181f34d6ee-000000", 
}

Request syntax with placeholder values


resp = client.send_email({
  source: "Address", # required
  destination: { # required
    to_addresses: ["Address"],
    cc_addresses: ["Address"],
    bcc_addresses: ["Address"],
  },
  message: { # required
    subject: { # required
      data: "MessageData", # required
      charset: "Charset",
    },
    body: { # required
      text: {
        data: "MessageData", # required
        charset: "Charset",
      },
      html: {
        data: "MessageData", # required
        charset: "Charset",
      },
    },
  },
  reply_to_addresses: ["Address"],
  return_path: "Address",
  source_arn: "AmazonResourceName",
  return_path_arn: "AmazonResourceName",
  tags: [
    {
      name: "MessageTagName", # required
      value: "MessageTagValue", # required
    },
  ],
  configuration_set_name: "ConfigurationSetName",
})

Response structure


resp.message_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :source (required, String)

    The email address that is sending the email. This email address must be either individually verified with Amazon SES, or from a domain that has been verified with Amazon SES. For information about verifying identities, see the Amazon SES Developer Guide.

    If you are sending on behalf of another user and have been permitted to do so by a sending authorization policy, then you must also specify the SourceArn parameter. For more information about sending authorization, see the Amazon SES Developer Guide.

    In all cases, the email address must be 7-bit ASCII. If the text must contain any other characters, then you must use MIME encoded-word syntax (RFC 2047) instead of a literal string. MIME encoded-word syntax uses the following form: =?charset?encoding?encoded-text?=. For more information, see RFC 2047.

  • :destination (required, Types::Destination)

    The destination for this email, composed of To:, CC:, and BCC: fields.

  • :message (required, Types::Message)

    The message to be sent.

  • :reply_to_addresses (Array<String>)

    The reply-to email address(es) for the message. If the recipient replies to the message, each reply-to address will receive the reply.

  • :return_path (String)

    The email address to which bounces and complaints are to be forwarded when feedback forwarding is enabled. If the message cannot be delivered to the recipient, then an error message will be returned from the recipient's ISP; this message will then be forwarded to the email address specified by the ReturnPath parameter. The ReturnPath parameter is never overwritten. This email address must be either individually verified with Amazon SES, or from a domain that has been verified with Amazon SES.

  • :source_arn (String)

    This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to send for the email address specified in the Source parameter.

    For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to send from user@example.com, then you would specify the SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the Source to be user@example.com.

    For more information about sending authorization, see the Amazon SES Developer Guide.

  • :return_path_arn (String)

    This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the ReturnPath parameter.

    For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use feedback@example.com, then you would specify the ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the ReturnPath to be feedback@example.com.

    For more information about sending authorization, see the Amazon SES Developer Guide.

  • :tags (Array<Types::MessageTag>)

    A list of tags, in the form of name/value pairs, to apply to an email that you send using SendEmail. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.

  • :configuration_set_name (String)

    The name of the configuration set to use when you send an email using SendEmail.

Returns:

See Also:



2469
2470
2471
2472
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2469

def send_email(params = {}, options = {})
  req = build_request(:send_email, params)
  req.send_request(options)
end

#send_raw_email(params = {}) ⇒ Types::SendRawEmailResponse

Sends an email message, with header and content specified by the client. The SendRawEmail action is useful for sending multipart MIME emails. The raw text of the message must comply with Internet email standards; otherwise, the message cannot be sent.

There are several important points to know about SendRawEmail:

  • You can only send email from verified email addresses and domains; otherwise, you will get an "Email address not verified" error. If your account is still in the Amazon SES sandbox, you must also verify every recipient email address except for the recipients provided by the Amazon SES mailbox simulator. For more information, go to the Amazon SES Developer Guide.

  • The total size of the message cannot exceed 10 MB. This includes any attachments that are part of the message.

  • You must provide at least one recipient email address. The recipient address can be a To: address, a CC: address, or a BCC: address. If any email address you provide is invalid, Amazon SES rejects the entire email.

  • Amazon SES has a limit on the total number of recipients per message. The combined number of To:, CC: and BCC: email addresses cannot exceed 50. If you need to send an email message to a larger audience, you can divide your recipient list into groups of 50 or fewer, and then call Amazon SES repeatedly to send the message to each group.

  • The To:, CC:, and BCC: headers in the raw message can contain a group list. Note that each recipient in a group list counts towards the 50-recipient limit.

  • Amazon SES overrides any Message-ID and Date headers you provide.

  • For every message that you send, the total number of recipients (To:, CC: and BCC:) is counted against your sending quota - the maximum number of emails you can send in a 24-hour period. For information about your sending quota, go to the Amazon SES Developer Guide.

  • If you are using sending authorization to send on behalf of another user, SendRawEmail enables you to specify the cross-account identity for the email's "Source," "From," and "Return-Path" parameters in one of two ways: you can pass optional parameters SourceArn, FromArn, and/or ReturnPathArn to the API, or you can include the following X-headers in the header of your raw email:

    • X-SES-SOURCE-ARN

    • X-SES-FROM-ARN

    • X-SES-RETURN-PATH-ARN

    Do not include these X-headers in the DKIM signature, because they are removed by Amazon SES before sending the email.

    For the most common sending authorization use case, we recommend that you specify the SourceIdentityArn and do not specify either the FromIdentityArn or ReturnPathIdentityArn. (The same note applies to the corresponding X-headers.) If you only specify the SourceIdentityArn, Amazon SES will simply set the "From" address and the "Return Path" address to the identity specified in SourceIdentityArn. For more information about sending authorization, see the Amazon SES Developer Guide.

Examples:

Example: SendRawEmail


# The following example sends an email with an attachment:

resp = client.send_raw_email({
  destinations: [
  ], 
  from_arn: "", 
  raw_message: {
    data: "From: sender@example.com\\nTo: recipient@example.com\\nSubject: Test email (contains an attachment)\\nMIME-Version: 1.0\\nContent-type: Multipart/Mixed; boundary=\"NextPart\"\\n\\n--NextPart\\nContent-Type: text/plain\\n\\nThis is the message body.\\n\\n--NextPart\\nContent-Type: text/plain;\\nContent-Disposition: attachment; filename=\"attachment.txt\"\\n\\nThis is the text in the attachment.\\n\\n--NextPart--", 
  }, 
  return_path_arn: "", 
  source: "", 
  source_arn: "", 
})

resp.to_h outputs the following:
{
  message_id: "EXAMPLEf3f73d99b-c63fb06f-d263-41f8-a0fb-d0dc67d56c07-000000", 
}

Request syntax with placeholder values


resp = client.send_raw_email({
  source: "Address",
  destinations: ["Address"],
  raw_message: { # required
    data: "data", # required
  },
  from_arn: "AmazonResourceName",
  source_arn: "AmazonResourceName",
  return_path_arn: "AmazonResourceName",
  tags: [
    {
      name: "MessageTagName", # required
      value: "MessageTagValue", # required
    },
  ],
  configuration_set_name: "ConfigurationSetName",
})

Response structure


resp.message_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :source (String)

    The identity's email address. If you do not provide a value for this parameter, you must specify a "From" address in the raw text of the message. (You can also specify both.)

    By default, the string must be 7-bit ASCII. If the text must contain any other characters, then you must use MIME encoded-word syntax (RFC 2047) instead of a literal string. MIME encoded-word syntax uses the following form: =?charset?encoding?encoded-text?=. For more information, see RFC 2047.

    If you specify the Source parameter and have feedback forwarding enabled, then bounces and complaints will be sent to this email address. This takes precedence over any Return-Path header that you might include in the raw text of the message.

  • :destinations (Array<String>)

    A list of destinations for the message, consisting of To:, CC:, and BCC: addresses.

  • :raw_message (required, Types::RawMessage)

    The raw text of the message. The client is responsible for ensuring the following:

    • Message must contain a header and a body, separated by a blank line.

    • All required header fields must be present.

    • Each part of a multipart MIME message must be formatted properly.

    • MIME content types must be among those supported by Amazon SES. For more information, go to the Amazon SES Developer Guide.

    • Must be base64-encoded.

    • Per RFC 5321, the maximum length of each line of text, including the <CRLF>, must not exceed 1,000 characters.

  • :from_arn (String)

    This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to specify a particular "From" address in the header of the raw email.

    Instead of using this parameter, you can use the X-header X-SES-FROM-ARN in the raw message of the email. If you use both the FromArn parameter and the corresponding X-header, Amazon SES uses the value of the FromArn parameter.

    For information about when to use this parameter, see the description of SendRawEmail in this guide, or see the Amazon SES Developer Guide.

  • :source_arn (String)

    This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to send for the email address specified in the Source parameter.

    For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to send from user@example.com, then you would specify the SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the Source to be user@example.com.

    Instead of using this parameter, you can use the X-header X-SES-SOURCE-ARN in the raw message of the email. If you use both the SourceArn parameter and the corresponding X-header, Amazon SES uses the value of the SourceArn parameter.

    For information about when to use this parameter, see the description of SendRawEmail in this guide, or see the Amazon SES Developer Guide.

  • :return_path_arn (String)

    This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the ReturnPath parameter.

    For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use feedback@example.com, then you would specify the ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the ReturnPath to be feedback@example.com.

    Instead of using this parameter, you can use the X-header X-SES-RETURN-PATH-ARN in the raw message of the email. If you use both the ReturnPathArn parameter and the corresponding X-header, Amazon SES uses the value of the ReturnPathArn parameter.

    For information about when to use this parameter, see the description of SendRawEmail in this guide, or see the Amazon SES Developer Guide.

  • :tags (Array<Types::MessageTag>)

    A list of tags, in the form of name/value pairs, to apply to an email that you send using SendRawEmail. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.

  • :configuration_set_name (String)

    The name of the configuration set to use when you send an email using SendRawEmail.

Returns:

See Also:



2736
2737
2738
2739
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2736

def send_raw_email(params = {}, options = {})
  req = build_request(:send_raw_email, params)
  req.send_request(options)
end

#set_active_receipt_rule_set(params = {}) ⇒ Struct

Sets the specified receipt rule set as the active receipt rule set.

To disable your email-receiving through Amazon SES completely, you can call this API with RuleSetName set to null.

For information about managing receipt rule sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: SetActiveReceiptRuleSet


# The following example sets the active receipt rule set:

resp = client.set_active_receipt_rule_set({
  rule_set_name: "RuleSetToActivate", 
})

Request syntax with placeholder values


resp = client.set_active_receipt_rule_set({
  rule_set_name: "ReceiptRuleSetName",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (String)

    The name of the receipt rule set to make active. Setting this value to null disables all email receiving.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2782
2783
2784
2785
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2782

def set_active_receipt_rule_set(params = {}, options = {})
  req = build_request(:set_active_receipt_rule_set, params)
  req.send_request(options)
end

#set_identity_dkim_enabled(params = {}) ⇒ Struct

Enables or disables Easy DKIM signing of email sent from an identity:

  • If Easy DKIM signing is enabled for a domain name identity (e.g., example.com), then Amazon SES will DKIM-sign all email sent by addresses under that domain name (e.g., user@example.com).

  • If Easy DKIM signing is enabled for an email address, then Amazon SES will DKIM-sign all email sent by that email address.

For email addresses (e.g., user@example.com), you can only enable Easy DKIM signing if the corresponding domain (e.g., example.com) has been set up for Easy DKIM using the AWS Console or the VerifyDomainDkim action.

This action is throttled at one request per second.

For more information about Easy DKIM signing, go to the Amazon SES Developer Guide.

Examples:

Example: SetIdentityDkimEnabled


# The following example configures Amazon SES to Easy DKIM-sign the email sent from an identity:

resp = client.set_identity_dkim_enabled({
  dkim_enabled: true, 
  identity: "user@example.com", 
})

Request syntax with placeholder values


resp = client.set_identity_dkim_enabled({
  identity: "Identity", # required
  dkim_enabled: false, # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The identity for which DKIM signing should be enabled or disabled.

  • :dkim_enabled (required, Boolean)

    Sets whether DKIM signing is enabled for an identity. Set to true to enable DKIM signing for this identity; false to disable it.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2840
2841
2842
2843
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2840

def set_identity_dkim_enabled(params = {}, options = {})
  req = build_request(:set_identity_dkim_enabled, params)
  req.send_request(options)
end

#set_identity_feedback_forwarding_enabled(params = {}) ⇒ Struct

Given an identity (an email address or a domain), enables or disables whether Amazon SES forwards bounce and complaint notifications as email. Feedback forwarding can only be disabled when Amazon Simple Notification Service (Amazon SNS) topics are specified for both bounces and complaints.

Feedback forwarding does not apply to delivery notifications. Delivery notifications are only available through Amazon SNS.

This action is throttled at one request per second.

For more information about using notifications with Amazon SES, see the Amazon SES Developer Guide.

Examples:

Example: SetIdentityFeedbackForwardingEnabled


# The following example configures Amazon SES to forward an identity's bounces and complaints via email:

resp = client.set_identity_feedback_forwarding_enabled({
  forwarding_enabled: true, 
  identity: "user@example.com", 
})

Request syntax with placeholder values


resp = client.set_identity_feedback_forwarding_enabled({
  identity: "Identity", # required
  forwarding_enabled: false, # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The identity for which to set bounce and complaint notification forwarding. Examples: user@example.com, example.com.

  • :forwarding_enabled (required, Boolean)

    Sets whether Amazon SES will forward bounce and complaint notifications as email. true specifies that Amazon SES will forward bounce and complaint notifications as email, in addition to any Amazon SNS topic publishing otherwise specified. false specifies that Amazon SES will publish bounce and complaint notifications only through Amazon SNS. This value can only be set to false when Amazon SNS topics are set for both Bounce and Complaint notification types.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2902
2903
2904
2905
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2902

def set_identity_feedback_forwarding_enabled(params = {}, options = {})
  req = build_request(:set_identity_feedback_forwarding_enabled, params)
  req.send_request(options)
end

#set_identity_headers_in_notifications_enabled(params = {}) ⇒ Struct

Given an identity (an email address or a domain), sets whether Amazon SES includes the original email headers in the Amazon Simple Notification Service (Amazon SNS) notifications of a specified type.

This action is throttled at one request per second.

For more information about using notifications with Amazon SES, see the Amazon SES Developer Guide.

Examples:

Example: SetIdentityHeadersInNotificationsEnabled


# The following example configures Amazon SES to include the original email headers in the Amazon SNS bounce notifications for an identity:

resp = client.set_identity_headers_in_notifications_enabled({
  enabled: true, 
  identity: "user@example.com", 
  notification_type: "Bounce", 
})

Request syntax with placeholder values


resp = client.set_identity_headers_in_notifications_enabled({
  identity: "Identity", # required
  notification_type: "Bounce", # required, accepts Bounce, Complaint, Delivery
  enabled: false, # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The identity for which to enable or disable headers in notifications. Examples: user@example.com, example.com.

  • :notification_type (required, String)

    The notification type for which to enable or disable headers in notifications.

  • :enabled (required, Boolean)

    Sets whether Amazon SES includes the original email headers in Amazon SNS notifications of the specified notification type. A value of true specifies that Amazon SES will include headers in notifications, and a value of false specifies that Amazon SES will not include headers in notifications.

    This value can only be set when NotificationType is already set to use a particular Amazon SNS topic.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2963
2964
2965
2966
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 2963

def set_identity_headers_in_notifications_enabled(params = {}, options = {})
  req = build_request(:set_identity_headers_in_notifications_enabled, params)
  req.send_request(options)
end

#set_identity_mail_from_domain(params = {}) ⇒ Struct

Enables or disables the custom MAIL FROM domain setup for a verified identity (an email address or a domain).

To send emails using the specified MAIL FROM domain, you must add an MX record to your MAIL FROM domain's DNS settings. If you want your emails to pass Sender Policy Framework (SPF) checks, you must also add or update an SPF record. For more information, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: SetIdentityMailFromDomain


# The following example configures Amazon SES to use a custom MAIL FROM domain for an identity:

resp = client.set_identity_mail_from_domain({
  behavior_on_mx_failure: "UseDefaultValue", 
  identity: "user@example.com", 
  mail_from_domain: "bounces.example.com", 
})

Request syntax with placeholder values


resp = client.set_identity_mail_from_domain({
  identity: "Identity", # required
  mail_from_domain: "MailFromDomainName",
  behavior_on_mx_failure: "UseDefaultValue", # accepts UseDefaultValue, RejectMessage
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The verified identity for which you want to enable or disable the specified custom MAIL FROM domain.

  • :mail_from_domain (String)

    The custom MAIL FROM domain that you want the verified identity to use. The MAIL FROM domain must 1) be a subdomain of the verified identity, 2) not be used in a "From" address if the MAIL FROM domain is the destination of email feedback forwarding (for more information, see the Amazon SES Developer Guide), and 3) not be used to receive emails. A value of null disables the custom MAIL FROM setting for the identity.

  • :behavior_on_mx_failure (String)

    The action that you want Amazon SES to take if it cannot successfully read the required MX record when you send an email. If you choose UseDefaultValue, Amazon SES will use amazonses.com (or a subdomain of that) as the MAIL FROM domain. If you choose RejectMessage, Amazon SES will return a MailFromDomainNotVerified error and not send the email.

    The action specified in BehaviorOnMXFailure is taken when the custom MAIL FROM domain setup is in the Pending, Failed, and TemporaryFailure states.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3037
3038
3039
3040
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3037

def set_identity_mail_from_domain(params = {}, options = {})
  req = build_request(:set_identity_mail_from_domain, params)
  req.send_request(options)
end

#set_identity_notification_topic(params = {}) ⇒ Struct

Given an identity (an email address or a domain), sets the Amazon Simple Notification Service (Amazon SNS) topic to which Amazon SES will publish bounce, complaint, and/or delivery notifications for emails sent with that identity as the Source.

Unless feedback forwarding is enabled, you must specify Amazon SNS topics for bounce and complaint notifications. For more information, see SetIdentityFeedbackForwardingEnabled.

This action is throttled at one request per second.

For more information about feedback notification, see the Amazon SES Developer Guide.

Examples:

Example: SetIdentityNotificationTopic


# The following example sets the Amazon SNS topic to which Amazon SES will publish bounce, complaint, and/or delivery notifications for emails sent with the specified identity as the Source:

resp = client.set_identity_notification_topic({
  identity: "user@example.com", 
  notification_type: "Bounce", 
  sns_topic: "arn:aws:sns:us-west-2:111122223333:MyTopic", 
})

Request syntax with placeholder values


resp = client.set_identity_notification_topic({
  identity: "Identity", # required
  notification_type: "Bounce", # required, accepts Bounce, Complaint, Delivery
  sns_topic: "NotificationTopic",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity (required, String)

    The identity for which the Amazon SNS topic will be set. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com.

  • :notification_type (required, String)

    The type of notifications that will be published to the specified Amazon SNS topic.

  • :sns_topic (String)

    The Amazon Resource Name (ARN) of the Amazon SNS topic. If the parameter is omitted from the request or a null value is passed, SnsTopic is cleared and publishing is disabled.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3102
3103
3104
3105
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3102

def set_identity_notification_topic(params = {}, options = {})
  req = build_request(:set_identity_notification_topic, params)
  req.send_request(options)
end

#set_receipt_rule_position(params = {}) ⇒ Struct

Sets the position of the specified receipt rule in the receipt rule set.

For information about managing receipt rules, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: SetReceiptRulePosition


# The following example sets the position of a receipt rule in a receipt rule set:

resp = client.set_receipt_rule_position({
  after: "PutRuleAfterThisRule", 
  rule_name: "RuleToReposition", 
  rule_set_name: "MyRuleSet", 
})

Request syntax with placeholder values


resp = client.set_receipt_rule_position({
  rule_set_name: "ReceiptRuleSetName", # required
  rule_name: "ReceiptRuleName", # required
  after: "ReceiptRuleName",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the receipt rule set that contains the receipt rule to reposition.

  • :rule_name (required, String)

    The name of the receipt rule to reposition.

  • :after (String)

    The name of the receipt rule after which to place the specified receipt rule.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3155
3156
3157
3158
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3155

def set_receipt_rule_position(params = {}, options = {})
  req = build_request(:set_receipt_rule_position, params)
  req.send_request(options)
end

#update_configuration_set_event_destination(params = {}) ⇒ Struct

Updates the event destination of a configuration set.

When you create or update an event destination, you must provide one, and only one, destination. The destination can be Amazon CloudWatch, Amazon Kinesis Firehose, or Amazon Simple Notification Service (Amazon SNS).

Event destinations are associated with configuration sets, which enable you to publish email sending events to Amazon CloudWatch, Amazon Kinesis Firehose, or Amazon Simple Notification Service (Amazon SNS). For information about using configuration sets, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Request syntax with placeholder values


resp = client.update_configuration_set_event_destination({
  configuration_set_name: "ConfigurationSetName", # required
  event_destination: { # required
    name: "EventDestinationName", # required
    enabled: false,
    matching_event_types: ["send"], # required, accepts send, reject, bounce, complaint, delivery, open, click
    kinesis_firehose_destination: {
      iam_role_arn: "AmazonResourceName", # required
      delivery_stream_arn: "AmazonResourceName", # required
    },
    cloud_watch_destination: {
      dimension_configurations: [ # required
        {
          dimension_name: "DimensionName", # required
          dimension_value_source: "messageTag", # required, accepts messageTag, emailHeader, linkTag
          default_dimension_value: "DefaultDimensionValue", # required
        },
      ],
    },
    sns_destination: {
      topic_arn: "AmazonResourceName", # required
    },
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :configuration_set_name (required, String)

    The name of the configuration set that you want to update.

  • :event_destination (required, Types::EventDestination)

    The event destination object that you want to apply to the specified configuration set.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3221
3222
3223
3224
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3221

def update_configuration_set_event_destination(params = {}, options = {})
  req = build_request(:update_configuration_set_event_destination, params)
  req.send_request(options)
end

#update_receipt_rule(params = {}) ⇒ Struct

Updates a receipt rule.

For information about managing receipt rules, see the Amazon SES Developer Guide.

This action is throttled at one request per second.

Examples:

Example: UpdateReceiptRule


# The following example updates a receipt rule to use an Amazon S3 action:

resp = client.update_receipt_rule({
  rule: {
    actions: [
      {
        s3_action: {
          bucket_name: "MyBucket", 
          object_key_prefix: "email", 
        }, 
      }, 
    ], 
    enabled: true, 
    name: "MyRule", 
    scan_enabled: true, 
    tls_policy: "Optional", 
  }, 
  rule_set_name: "MyRuleSet", 
})

Request syntax with placeholder values


resp = client.update_receipt_rule({
  rule_set_name: "ReceiptRuleSetName", # required
  rule: { # required
    name: "ReceiptRuleName", # required
    enabled: false,
    tls_policy: "Require", # accepts Require, Optional
    recipients: ["Recipient"],
    actions: [
      {
        s3_action: {
          topic_arn: "AmazonResourceName",
          bucket_name: "S3BucketName", # required
          object_key_prefix: "S3KeyPrefix",
          kms_key_arn: "AmazonResourceName",
        },
        bounce_action: {
          topic_arn: "AmazonResourceName",
          smtp_reply_code: "BounceSmtpReplyCode", # required
          status_code: "BounceStatusCode",
          message: "BounceMessage", # required
          sender: "Address", # required
        },
        workmail_action: {
          topic_arn: "AmazonResourceName",
          organization_arn: "AmazonResourceName", # required
        },
        lambda_action: {
          topic_arn: "AmazonResourceName",
          function_arn: "AmazonResourceName", # required
          invocation_type: "Event", # accepts Event, RequestResponse
        },
        stop_action: {
          scope: "RuleSet", # required, accepts RuleSet
          topic_arn: "AmazonResourceName",
        },
        add_header_action: {
          header_name: "HeaderName", # required
          header_value: "HeaderValue", # required
        },
        sns_action: {
          topic_arn: "AmazonResourceName", # required
          encoding: "UTF-8", # accepts UTF-8, Base64
        },
      },
    ],
    scan_enabled: false,
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :rule_set_name (required, String)

    The name of the receipt rule set to which the receipt rule belongs.

  • :rule (required, Types::ReceiptRule)

    A data structure that contains the updated receipt rule information.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3323
3324
3325
3326
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3323

def update_receipt_rule(params = {}, options = {})
  req = build_request(:update_receipt_rule, params)
  req.send_request(options)
end

#verify_domain_dkim(params = {}) ⇒ Types::VerifyDomainDkimResponse

Returns a set of DKIM tokens for a domain. DKIM tokens are character strings that represent your domain's identity. Using these tokens, you will need to create DNS CNAME records that point to DKIM public keys hosted by Amazon SES. Amazon Web Services will eventually detect that you have updated your DNS records; this detection process may take up to 72 hours. Upon successful detection, Amazon SES will be able to DKIM-sign email originating from that domain.

This action is throttled at one request per second.

To enable or disable Easy DKIM signing for a domain, use the SetIdentityDkimEnabled action.

For more information about creating DNS records using DKIM tokens, go to the Amazon SES Developer Guide.

Examples:

Example: VerifyDomainDkim


# The following example generates DKIM tokens for a domain that has been verified with Amazon SES:

resp = client.verify_domain_dkim({
  domain: "example.com", 
})

resp.to_h outputs the following:
{
  dkim_tokens: [
    "EXAMPLEq76owjnks3lnluwg65scbemvw", 
    "EXAMPLEi3dnsj67hstzaj673klariwx2", 
    "EXAMPLEwfbtcukvimehexktmdtaz6naj", 
  ], 
}

Request syntax with placeholder values


resp = client.verify_domain_dkim({
  domain: "Domain", # required
})

Response structure


resp.dkim_tokens #=> Array
resp.dkim_tokens[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :domain (required, String)

    The name of the domain to be verified for Easy DKIM signing.

Returns:

See Also:



3388
3389
3390
3391
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3388

def verify_domain_dkim(params = {}, options = {})
  req = build_request(:verify_domain_dkim, params)
  req.send_request(options)
end

#verify_domain_identity(params = {}) ⇒ Types::VerifyDomainIdentityResponse

Verifies a domain.

This action is throttled at one request per second.

Examples:

Example: VerifyDomainIdentity


# The following example starts the domain verification process with Amazon SES:

resp = client.verify_domain_identity({
  domain: "example.com", 
})

resp.to_h outputs the following:
{
  verification_token: "eoEmxw+YaYhb3h3iVJHuXMJXqeu1q1/wwmvjuEXAMPLE", 
}

Request syntax with placeholder values


resp = client.verify_domain_identity({
  domain: "Domain", # required
})

Response structure


resp.verification_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :domain (required, String)

    The domain to be verified.

Returns:

See Also:



3432
3433
3434
3435
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3432

def verify_domain_identity(params = {}, options = {})
  req = build_request(:verify_domain_identity, params)
  req.send_request(options)
end

#verify_email_address(params = {}) ⇒ Struct

Verifies an email address. This action causes a confirmation email message to be sent to the specified address.

The VerifyEmailAddress action is deprecated as of the May 15, 2012 release of Domain Verification. The VerifyEmailIdentity action is now preferred.

This action is throttled at one request per second.

Examples:

Example: VerifyEmailAddress


# The following example starts the email address verification process with Amazon SES:

resp = client.verify_email_address({
  email_address: "user@example.com", 
})

Request syntax with placeholder values


resp = client.verify_email_address({
  email_address: "Address", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :email_address (required, String)

    The email address to be verified.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3470
3471
3472
3473
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3470

def verify_email_address(params = {}, options = {})
  req = build_request(:verify_email_address, params)
  req.send_request(options)
end

#verify_email_identity(params = {}) ⇒ Struct

Verifies an email address. This action causes a confirmation email message to be sent to the specified address.

This action is throttled at one request per second.

Examples:

Example: VerifyEmailIdentity


# The following example starts the email address verification process with Amazon SES:

resp = client.verify_email_identity({
  email_address: "user@example.com", 
})

Request syntax with placeholder values


resp = client.verify_email_identity({
  email_address: "Address", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :email_address (required, String)

    The email address to be verified.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3504
3505
3506
3507
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3504

def verify_email_identity(params = {}, options = {})
  req = build_request(:verify_email_identity, params)
  req.send_request(options)
end

#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean

Polls an API operation until a resource enters a desired state.

Basic Usage

A waiter will call an API operation until:

  • It is successful
  • It enters a terminal state
  • It makes the maximum number of attempts

In between attempts, the waiter will sleep.

# polls in a loop, sleeping between attempts
client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.

# poll for ~25 seconds
client.wait_until(waiter_name, params, {
  max_attempts: 5,
  delay: 5,
})

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(waiter_name, params, {

  # disable max attempts
  max_attempts: nil,

  # poll for 1 hour, instead of a number of attempts
  before_wait: -> (attempts, response) do
    throw :failure if Time.now - started_at > 3600
  end
})

Handling Errors

When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Valid Waiters

The following table lists the valid waiter names, the operations they call, and the default :delay and :max_attempts values.

waiter_name params :delay :max_attempts
identity_exists #get_identity_verification_attributes 3 20

Parameters:

  • waiter_name (Symbol)
  • params (Hash) (defaults to: {})

    ({})

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :max_attempts (Integer)
  • :delay (Integer)
  • :before_attempt (Proc)
  • :before_wait (Proc)

Yields:

  • (w.waiter)

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.



3614
3615
3616
3617
3618
# File 'gems/aws-sdk-ses/lib/aws-sdk-ses/client.rb', line 3614

def wait_until(waiter_name, params = {}, options = {})
  w = waiter(waiter_name, options)
  yield(w.waiter) if block_given? # deprecated
  w.wait(params)
end