Skip to content

send_bulk_email

send_bulk_email(
    default_content: BulkEmailContent,
    bulk_email_entries: BulkEmailEntryList,
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
    from_email_address: Optional[EmailAddress] = None,
    from_email_address_identity_arn: Optional[AmazonResourceName] = None,
    reply_to_addresses: Optional[EmailAddressList] = None,
    feedback_forwarding_email_address: Optional[EmailAddress] = None,
    feedback_forwarding_email_address_identity_arn: Optional[AmazonResourceName] = None,
    default_email_tags: Optional[MessageTagList] = None,
    configuration_set_name: Optional[ConfigurationSetName] = None,
    endpoint_id: Optional[EndpointId] = None,
    tenant_name: Optional[TenantName] = None,
    configuration_overrides: Optional[ConfigurationOverrides] = None,
) -> SendBulkEmailResponse

Composes an email message to multiple destinations.

Parameters:

  • from_email_address (Optional[EmailAddress], default: None ) –

    The email address to use as the "From" address for the email. The address that you specify has to be verified.

  • from_email_address_identity_arn (Optional[AmazonResourceName], default: None ) –

    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 FromEmailAddress 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 [email protected], then you would specify the FromEmailAddressIdentityArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FromEmailAddress to be [email protected].

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

  • reply_to_addresses (Optional[EmailAddressList], default: None ) –

    The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.

  • feedback_forwarding_email_address (Optional[EmailAddress], default: None ) –

    The address that you want bounce and complaint notifications to be sent to.

  • feedback_forwarding_email_address_identity_arn (Optional[AmazonResourceName], default: None ) –

    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 FeedbackForwardingEmailAddress 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 [email protected], then you would specify the FeedbackForwardingEmailAddressIdentityArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FeedbackForwardingEmailAddress to be [email protected].

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

  • default_email_tags (Optional[MessageTagList], default: None ) –

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

  • default_content (BulkEmailContent) –

    An object that contains the body of the message. You can specify a template message.

  • bulk_email_entries (BulkEmailEntryList) –

    The list of bulk email entry objects.

  • configuration_set_name (Optional[ConfigurationSetName], default: None ) –

    The name of the configuration set to use when sending the email.

  • endpoint_id (Optional[EndpointId], default: None ) –

    The ID of the multi-region endpoint (global-endpoint).

  • tenant_name (Optional[TenantName], default: None ) –

    The name of the tenant through which this bulk email will be sent.

    The email sending operation will only succeed if all referenced resources (identities, configuration sets, and templates) are associated with this tenant.

  • configuration_overrides (Optional[ConfigurationOverrides], default: None ) –

    An object that overrides, for the messages in this request only, settings that would otherwise apply to them. The overrides apply to every message in the request. Each setting that you don't override keeps the value that already applies.

Raises:

Source code in docs_src/capo_sesv2/_services/se_sv2.py
def send_bulk_email(
    self,
    default_content: "capo_sesv2.types.bulk_email_content.BulkEmailContent",
    bulk_email_entries: "capo_sesv2.types.bulk_email_entry_list.BulkEmailEntryList",
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
    from_email_address: Optional[
        "capo_sesv2.types.email_address.EmailAddress"
    ] = None,
    from_email_address_identity_arn: Optional[
        "capo_sesv2.types.amazon_resource_name.AmazonResourceName"
    ] = None,
    reply_to_addresses: Optional[
        "capo_sesv2.types.email_address_list.EmailAddressList"
    ] = None,
    feedback_forwarding_email_address: Optional[
        "capo_sesv2.types.email_address.EmailAddress"
    ] = None,
    feedback_forwarding_email_address_identity_arn: Optional[
        "capo_sesv2.types.amazon_resource_name.AmazonResourceName"
    ] = None,
    default_email_tags: Optional[
        "capo_sesv2.types.message_tag_list.MessageTagList"
    ] = None,
    configuration_set_name: Optional[
        "capo_sesv2.types.configuration_set_name.ConfigurationSetName"
    ] = None,
    endpoint_id: Optional["capo_sesv2.types.endpoint_id.EndpointId"] = None,
    tenant_name: Optional["capo_sesv2.types.tenant_name.TenantName"] = None,
    configuration_overrides: Optional[
        "capo_sesv2.types.configuration_overrides.ConfigurationOverrides"
    ] = None,
) -> "capo_sesv2.types.send_bulk_email_response.SendBulkEmailResponse":
    """<p>Composes an email message to multiple destinations.</p>

    Args:
        from_email_address: <p>The email address to use as the "From" address for the email. The address that you specify has to be verified.</p>
        from_email_address_identity_arn: <p>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 <code>FromEmailAddress</code> parameter.</p> <p>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 [email protected], then you would specify the <code>FromEmailAddressIdentityArn</code> to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the <code>FromEmailAddress</code> to be [email protected].</p> <p>For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
        reply_to_addresses: <p>The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.</p>
        feedback_forwarding_email_address: <p>The address that you want bounce and complaint notifications to be sent to.</p>
        feedback_forwarding_email_address_identity_arn: <p>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 <code>FeedbackForwardingEmailAddress</code> parameter.</p> <p>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 [email protected], then you would specify the <code>FeedbackForwardingEmailAddressIdentityArn</code> to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the <code>FeedbackForwardingEmailAddress</code> to be [email protected].</p> <p>For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
        default_email_tags: <p>A list of tags, in the form of name/value pairs, to apply to an email that you send using the <code>SendEmail</code> operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.</p>
        default_content: <p>An object that contains the body of the message. You can specify a template message.</p>
        bulk_email_entries: <p>The list of bulk email entry objects.</p>
        configuration_set_name: <p>The name of the configuration set to use when sending the email.</p>
        endpoint_id: <p>The ID of the multi-region endpoint (global-endpoint).</p>
        tenant_name: <p>The name of the tenant through which this bulk email will be sent.</p> <note> <p> The email sending operation will only succeed if all referenced resources (identities, configuration sets, and templates) are associated with this tenant. </p> </note>
        configuration_overrides: <p>An object that overrides, for the messages in this request only, settings that would otherwise apply to them. The overrides apply to every message in the request. Each setting that you don't override keeps the value that already applies.</p>

    Raises:
        capo_sesv2.errors.account_suspended_exception.AccountSuspendedException: <p>The message can't be sent because the account's ability to send email has been permanently restricted.</p>
        capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_sesv2.errors.limit_exceeded_exception.LimitExceededException: <p>There are too many instances of the specified resource type.</p>
        capo_sesv2.errors.mail_from_domain_not_verified_exception.MailFromDomainNotVerifiedException: <p>The message can't be sent because the sending domain isn't verified.</p>
        capo_sesv2.errors.message_rejected.MessageRejected: <p>The message can't be sent because it contains invalid content.</p>
        capo_sesv2.errors.not_found_exception.NotFoundException: <p>The resource you attempted to access doesn't exist.</p>
        capo_sesv2.errors.sending_paused_exception.SendingPausedException: <p>The message can't be sent because the account's ability to send email is currently paused.</p>
        capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
        capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sesv2.types.send_bulk_email_request.SendBulkEmailRequest]",
    ) -> OperationResponse[
        "capo_sesv2.types.send_bulk_email_response.SendBulkEmailResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.send_bulk_email

        output, http_response = (
            capo_sesv2._operations.simple_email_service_v2.send_bulk_email.send_bulk_email(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SendBulkEmail")
    )
    input_: capo_sesv2.types.send_bulk_email_request.SendBulkEmailRequest = {
        "default_content": default_content,
        "bulk_email_entries": bulk_email_entries,
    }
    if from_email_address is not None:
        input_["from_email_address"] = from_email_address
    if from_email_address_identity_arn is not None:
        input_["from_email_address_identity_arn"] = from_email_address_identity_arn
    if reply_to_addresses is not None:
        input_["reply_to_addresses"] = reply_to_addresses
    if feedback_forwarding_email_address is not None:
        input_["feedback_forwarding_email_address"] = (
            feedback_forwarding_email_address
        )
    if feedback_forwarding_email_address_identity_arn is not None:
        input_["feedback_forwarding_email_address_identity_arn"] = (
            feedback_forwarding_email_address_identity_arn
        )
    if default_email_tags is not None:
        input_["default_email_tags"] = default_email_tags
    if configuration_set_name is not None:
        input_["configuration_set_name"] = configuration_set_name
    if endpoint_id is not None:
        input_["endpoint_id"] = endpoint_id
    if tenant_name is not None:
        input_["tenant_name"] = tenant_name
    if configuration_overrides is not None:
        input_["configuration_overrides"] = configuration_overrides

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output