Amazon Simple Email Service

2017/11/15 - Amazon Simple Email Service - 4 new 2 updated api methods

Changes  SES launches Configuration Set Reputation Metrics and Email Pausing Today, two features that build upon the capabilities of the reputation dashboard. The first is the ability to export reputation metrics for individual configuration sets. The second is the ability to temporarily pause email sending, either at the configuration set level, or across your entire Amazon SES account.

GetAccountSendingEnabled (new) Link ¶

Returns the email sending status of the Amazon SES account.

You can execute this operation no more than once per second.

See also: AWS API Documentation

Request Syntax

client.get_account_sending_enabled()
rtype

dict

returns

Response Syntax

{
    'Enabled': True|False
}

Response Structure

  • (dict) --

    Represents a request to return the email sending status for your Amazon SES account.

    • Enabled (boolean) --

      Describes whether email sending is enabled or disabled for your Amazon SES account.

UpdateConfigurationSetSendingEnabled (new) Link ¶

Enables or disables email sending for messages sent using a specific configuration set. You can use this operation in conjunction with Amazon CloudWatch alarms to temporarily pause email sending for a configuration set when the reputation metrics for that configuration set (such as your bounce on complaint rate) reach certain thresholds.

You can execute this operation no more than once per second.

See also: AWS API Documentation

Request Syntax

client.update_configuration_set_sending_enabled(
    ConfigurationSetName='string',
    Enabled=True|False
)
type ConfigurationSetName

string

param ConfigurationSetName

[REQUIRED]

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

type Enabled

boolean

param Enabled

[REQUIRED]

Describes whether email sending is enabled or disabled for the configuration set.

returns

None

UpdateAccountSendingEnabled (new) Link ¶

Enables or disables email sending across your entire Amazon SES account. You can use this operation in conjunction with Amazon CloudWatch alarms to temporarily pause email sending across your Amazon SES account when reputation metrics (such as your bounce on complaint rate) reach certain thresholds.

You can execute this operation no more than once per second.

See also: AWS API Documentation

Request Syntax

client.update_account_sending_enabled(
    Enabled=True|False
)
type Enabled

boolean

param Enabled

Describes whether email sending is enabled or disabled for your Amazon SES account.

returns

None

UpdateConfigurationSetReputationMetricsEnabled (new) Link ¶

Enables or disables the publishing of reputation metrics for emails sent using a specific configuration set. Reputation metrics include bounce and complaint rates. These metrics are published to Amazon CloudWatch. By using Amazon CloudWatch, you can create alarms when bounce or complaint rates exceed a certain threshold.

You can execute this operation no more than once per second.

See also: AWS API Documentation

Request Syntax

client.update_configuration_set_reputation_metrics_enabled(
    ConfigurationSetName='string',
    Enabled=True|False
)
type ConfigurationSetName

string

param ConfigurationSetName

[REQUIRED]

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

type Enabled

boolean

param Enabled

[REQUIRED]

Describes whether or not Amazon SES will publish reputation metrics for the configuration set, such as bounce and complaint rates, to Amazon CloudWatch.

returns

None

DescribeConfigurationSet (updated) Link ¶
Changes (request, response)
Request
{'ConfigurationSetAttributeNames': {'reputationOptions'}}
Response
{'ReputationOptions': {'LastFreshStart': 'timestamp',
                       'ReputationMetricsEnabled': 'boolean',
                       'SendingEnabled': 'boolean'}}

Returns the details of the specified configuration set. For information about using configuration sets, see the Amazon SES Developer Guide.

You can execute this operation no more than once per second.

See also: AWS API Documentation

Request Syntax

client.describe_configuration_set(
    ConfigurationSetName='string',
    ConfigurationSetAttributeNames=[
        'eventDestinations'|'trackingOptions'|'reputationOptions',
    ]
)
type ConfigurationSetName

string

param ConfigurationSetName

[REQUIRED]

The name of the configuration set to describe.

type ConfigurationSetAttributeNames

list

param ConfigurationSetAttributeNames

A list of configuration set attributes to return.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'ConfigurationSet': {
        'Name': 'string'
    },
    'EventDestinations': [
        {
            'Name': 'string',
            'Enabled': True|False,
            'MatchingEventTypes': [
                'send'|'reject'|'bounce'|'complaint'|'delivery'|'open'|'click'|'renderingFailure',
            ],
            'KinesisFirehoseDestination': {
                'IAMRoleARN': 'string',
                'DeliveryStreamARN': 'string'
            },
            'CloudWatchDestination': {
                'DimensionConfigurations': [
                    {
                        'DimensionName': 'string',
                        'DimensionValueSource': 'messageTag'|'emailHeader'|'linkTag',
                        'DefaultDimensionValue': 'string'
                    },
                ]
            },
            'SNSDestination': {
                'TopicARN': 'string'
            }
        },
    ],
    'TrackingOptions': {
        'CustomRedirectDomain': 'string'
    },
    'ReputationOptions': {
        'SendingEnabled': True|False,
        'ReputationMetricsEnabled': True|False,
        'LastFreshStart': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

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

    • ConfigurationSet (dict) --

      The configuration set object associated with the specified configuration set.

      • Name (string) --

        The name of the configuration set. The name must meet the following requirements:

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

        • Contain 64 characters or fewer.

    • EventDestinations (list) --

      A list of event destinations associated with the configuration set.

      • (dict) --

        Contains information about the event destination that the specified email sending events will be published to.

        Note

        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.

        • Name (string) --

          The name of the event destination. The name must:

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

          • Contain less than 64 characters.

        • Enabled (boolean) --

          Sets whether Amazon SES publishes events to this destination when you send an email with the associated configuration set. Set to true to enable publishing to this destination; set to false to prevent publishing to this destination. The default value is false .

        • MatchingEventTypes (list) --

          The type of email sending events to publish to the event destination.

          • (string) --

        • KinesisFirehoseDestination (dict) --

          An object that contains the delivery stream ARN and the IAM role ARN associated with an Amazon Kinesis Firehose event destination.

          • IAMRoleARN (string) --

            The ARN of the IAM role under which Amazon SES publishes email sending events to the Amazon Kinesis Firehose stream.

          • DeliveryStreamARN (string) --

            The ARN of the Amazon Kinesis Firehose stream that email sending events should be published to.

        • CloudWatchDestination (dict) --

          An object that contains the names, default values, and sources of the dimensions associated with an Amazon CloudWatch event destination.

          • DimensionConfigurations (list) --

            A list of dimensions upon which to categorize your emails when you publish email sending events to Amazon CloudWatch.

            • (dict) --

              Contains the dimension configuration to use when you publish email sending events to Amazon CloudWatch.

              For information about publishing email sending events to Amazon CloudWatch, see the Amazon SES Developer Guide.

              • DimensionName (string) --

                The name of an Amazon CloudWatch dimension associated with an email sending metric. The name must:

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

                • Contain less than 256 characters.

              • DimensionValueSource (string) --

                The place where Amazon SES finds the value of a dimension to publish to Amazon CloudWatch. If you want Amazon SES to use the message tags that you specify using an X-SES-MESSAGE-TAGS header or a parameter to the SendEmail / SendRawEmail API, choose messageTag . If you want Amazon SES to use your own email headers, choose emailHeader .

              • DefaultDimensionValue (string) --

                The default value of the dimension that is published to Amazon CloudWatch if you do not provide the value of the dimension when you send an email. The default value must:

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

                • Contain less than 256 characters.

        • SNSDestination (dict) --

          An object that contains the topic ARN associated with an Amazon Simple Notification Service (Amazon SNS) event destination.

          • TopicARN (string) --

            The ARN of the Amazon SNS topic that email sending events will be published to. An example of an Amazon SNS topic ARN is arn:aws:sns:us-west-2:123456789012:MyTopic . For more information about Amazon SNS topics, see the Amazon SNS Developer Guide.

    • TrackingOptions (dict) --

      The name of the custom open and click tracking domain associated with the configuration set.

      • CustomRedirectDomain (string) --

        The custom subdomain that will be used to redirect email recipients to the Amazon SES event tracking domain.

    • ReputationOptions (dict) --

      An object that represents the reputation settings for the configuration set.

      • SendingEnabled (boolean) --

        Describes whether email sending is enabled or disabled for the configuration set. If the value is true , then Amazon SES will send emails that use the configuration set. If the value is false , Amazon SES will not send emails that use the configuration set. The default value is true . You can change this setting using UpdateConfigurationSetSendingEnabled.

      • ReputationMetricsEnabled (boolean) --

        Describes whether or not Amazon SES publishes reputation metrics for the configuration set, such as bounce and complaint rates, to Amazon CloudWatch.

        If the value is true , reputation metrics are published. If the value is false , reputation metrics are not published. The default value is false .

      • LastFreshStart (datetime) --

        The date and time at which the reputation metrics for the configuration set were last reset. Resetting these metrics is known as a fresh start .

        When you disable email sending for a configuration set using UpdateConfigurationSetSendingEnabled and later re-enable it, the reputation metrics for the configuration set (but not for the entire Amazon SES account) are reset.

        If email sending for the configuration set has never been disabled and later re-enabled, the value of this attribute is null .

SendBulkTemplatedEmail (updated) Link ¶
Changes (response)
{'Status': {'Status': {'AccountSendingPaused',
                       'ConfigurationSetSendingPaused'}}}

Composes an email message to multiple destinations. The message body is created using an email template.

In order to send email using the SendBulkTemplatedEmail operation, your call to the API must meet the following requirements:

  • The call must refer to an existing email template. You can create email templates using the CreateTemplate operation.

  • The message must be sent from a verified email address or domain.

  • If your account is still in the Amazon SES sandbox, you may only send to verified addresses or domains, or to email addresses associated with the Amazon SES Mailbox Simulator. For more information, see Verifying Email Addresses and Domains in the Amazon SES Developer Guide.

  • The total size of the message, including attachments, must be less than 10 MB.

  • Each Destination parameter must include at least one recipient email address. The recipient address can be a To: address, a CC: address, or a BCC: address. If a recipient email address is invalid (that is, it is not in the format UserName@[SubDomain.]Domain.TopLevelDomain ), the entire message will be rejected, even if the message contains other recipients that are valid.

See also: AWS API Documentation

Request Syntax

client.send_bulk_templated_email(
    Source='string',
    SourceArn='string',
    ReplyToAddresses=[
        'string',
    ],
    ReturnPath='string',
    ReturnPathArn='string',
    ConfigurationSetName='string',
    DefaultTags=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    Template='string',
    TemplateArn='string',
    DefaultTemplateData='string',
    Destinations=[
        {
            'Destination': {
                'ToAddresses': [
                    'string',
                ],
                'CcAddresses': [
                    'string',
                ],
                'BccAddresses': [
                    'string',
                ]
            },
            'ReplacementTags': [
                {
                    'Name': 'string',
                    'Value': 'string'
                },
            ],
            'ReplacementTemplateData': 'string'
        },
    ]
)
type Source

string

param Source

[REQUIRED]

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.

type SourceArn

string

param SourceArn

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.

type ReplyToAddresses

list

param ReplyToAddresses

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

  • (string) --

type ReturnPath

string

param ReturnPath

The email address that bounces and complaints will be forwarded to 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.

type ReturnPathArn

string

param ReturnPathArn

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.

type ConfigurationSetName

string

param ConfigurationSetName

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

type DefaultTags

list

param DefaultTags

A list of tags, in the form of name/value pairs, to apply to an email that you send to a destination using SendBulkTemplatedEmail .

  • (dict) --

    Contains the name and value of a tag that you can provide to SendEmail or SendRawEmail to apply to an email.

    Message tags, which you use with configuration sets, enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide.

    • Name (string) -- [REQUIRED]

      The name of the tag. The name must:

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

      • Contain less than 256 characters.

    • Value (string) -- [REQUIRED]

      The value of the tag. The value must:

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

      • Contain less than 256 characters.

type Template

string

param Template

[REQUIRED]

The template to use when sending this email.

type TemplateArn

string

param TemplateArn

The ARN of the template to use when sending this email.

type DefaultTemplateData

string

param DefaultTemplateData

A list of replacement values to apply to the template when replacement data is not specified in a Destination object. These values act as a default or fallback option when no other data is available.

The template data is a JSON object, typically consisting of key-value pairs in which the keys correspond to replacement tags in the email template.

type Destinations

list

param Destinations

[REQUIRED]

One or more Destination objects. All of the recipients in a Destination will receive the same version of the email. You can specify up to 50 Destination objects within a Destinations array.

  • (dict) --

    An array that contains one or more Destinations, as well as the tags and replacement data associated with each of those Destinations.

    • Destination (dict) -- [REQUIRED]

      Represents the destination of the message, consisting of To:, CC:, and BCC: fields.

      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.

      • ToAddresses (list) --

        The To: field(s) of the message.

        • (string) --

      • CcAddresses (list) --

        The CC: field(s) of the message.

        • (string) --

      • BccAddresses (list) --

        The BCC: field(s) of the message.

        • (string) --

    • ReplacementTags (list) --

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

      • (dict) --

        Contains the name and value of a tag that you can provide to SendEmail or SendRawEmail to apply to an email.

        Message tags, which you use with configuration sets, enable you to publish email sending events. For information about using configuration sets, see the Amazon SES Developer Guide.

        • Name (string) -- [REQUIRED]

          The name of the tag. The name must:

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

          • Contain less than 256 characters.

        • Value (string) -- [REQUIRED]

          The value of the tag. The value must:

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

          • Contain less than 256 characters.

    • ReplacementTemplateData (string) --

      A list of replacement values to apply to the template. This parameter is a JSON object, typically consisting of key-value pairs in which the keys correspond to replacement tags in the email template.

rtype

dict

returns

Response Syntax

{
    'Status': [
        {
            'Status': 'Success'|'MessageRejected'|'MailFromDomainNotVerified'|'ConfigurationSetDoesNotExist'|'TemplateDoesNotExist'|'AccountSuspended'|'AccountThrottled'|'AccountDailyQuotaExceeded'|'InvalidSendingPoolName'|'AccountSendingPaused'|'ConfigurationSetSendingPaused'|'InvalidParameterValue'|'TransientFailure'|'Failed',
            'Error': 'string',
            'MessageId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Status (list) --

      The unique message identifier returned from the SendBulkTemplatedEmail action.

      • (dict) --

        An object that contains the response from the SendBulkTemplatedEmail operation.

        • Status (string) --

          The status of a message sent using the SendBulkTemplatedEmail operation.

          Possible values for this parameter include:

          • Success : Amazon SES accepted the message, and will attempt to deliver it to the recipients.

          • MessageRejected : The message was rejected because it contained a virus.

          • MailFromDomainNotVerified : The sender's email address or domain was not verified.

          • ConfigurationSetDoesNotExist : The configuration set you specified does not exist.

          • TemplateDoesNotExist : The template you specified does not exist.

          • AccountSuspended : Your account has been shut down because of issues related to your email sending practices.

          • AccountThrottled : The number of emails you can send has been reduced because your account has exceeded its allocated sending limit.

          • AccountDailyQuotaExceeded : You have reached or exceeded the maximum number of emails you can send from your account in a 24-hour period.

          • InvalidSendingPoolName : The configuration set you specified refers to an IP pool that does not exist.

          • AccountSendingPaused : Email sending for the Amazon SES account was disabled using the UpdateAccountSendingEnabled operation.

          • ConfigurationSetSendingPaused : Email sending for this configuration set was disabled using the UpdateConfigurationSetSendingEnabled operation.

          • InvalidParameterValue : One or more of the parameters you specified when calling this operation was invalid. See the error message for additional information.

          • TransientFailure : Amazon SES was unable to process your request because of a temporary issue.

          • Failed : Amazon SES was unable to process your request. See the error message for additional information.

        • Error (string) --

          A description of an error that prevented a message being sent using the SendBulkTemplatedEmail operation.

        • MessageId (string) --

          The unique message identifier returned from the SendBulkTemplatedEmail operation.