Jump to Content

Class SendBulkTemplatedEmailCommandProtected

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 maximum message size is 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.

  • The message may not include more than 50 recipients, across the To:, CC: and BCC: fields. 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 the SendBulkTemplatedEmail operation several times to send the message to each group.

  • The number of destinations you can contact in a single call to the API may be limited by your account's maximum sending rate.

Example

Use a bare-bones client and the command you need to make an API call.

import { SESClient, SendBulkTemplatedEmailCommand } from "@aws-sdk/client-ses"; // ES Modules import
// const { SESClient, SendBulkTemplatedEmailCommand } = require("@aws-sdk/client-ses"); // CommonJS import
const client = new SESClient(config);
const command = new SendBulkTemplatedEmailCommand(input);
const response = await client.send(command);

Param

SendBulkTemplatedEmailCommandInput

Returns

SendBulkTemplatedEmailCommandOutput

See

Throws

AccountSendingPausedException (client fault)

Indicates that email sending is disabled for your entire Amazon SES account.

You can enable or disable email sending for your Amazon SES account using UpdateAccountSendingEnabled.

Throws

ConfigurationSetDoesNotExistException (client fault)

Indicates that the configuration set does not exist.

Throws

ConfigurationSetSendingPausedException (client fault)

Indicates that email sending is disabled for the configuration set.

You can enable or disable email sending for a configuration set using UpdateConfigurationSetSendingEnabled.

Throws

MailFromDomainNotVerifiedException (client fault)

Indicates that the message could not be sent because Amazon SES could not read the MX record required to use the specified MAIL FROM domain. For information about editing the custom MAIL FROM domain settings for an identity, see the Amazon SES Developer Guide.

Throws

MessageRejected (client fault)

Indicates that the action failed, and the message could not be sent. Check the error stack for more information about what caused the error.

Throws

TemplateDoesNotExistException (client fault)

Indicates that the Template object you specified does not exist in your Amazon SES account.

Hierarchy

Constructors

Properties

Methods