CreateEmailTemplateCommand

Creates an email template. Email templates enable you to send personalized email to one or more destinations in a single API operation. For more information, see the Amazon SES Developer Guide .

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

Example Syntax

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

import { SESv2Client, CreateEmailTemplateCommand } from "@aws-sdk/client-sesv2"; // ES Modules import
// const { SESv2Client, CreateEmailTemplateCommand } = require("@aws-sdk/client-sesv2"); // CommonJS import
const client = new SESv2Client(config);
const input = { // CreateEmailTemplateRequest
  TemplateName: "STRING_VALUE", // required
  TemplateContent: { // EmailTemplateContent
    Subject: "STRING_VALUE",
    Text: "STRING_VALUE",
    Html: "STRING_VALUE",
  },
};
const command = new CreateEmailTemplateCommand(input);
const response = await client.send(command);
// {};

CreateEmailTemplateCommand Input

See CreateEmailTemplateCommandInput for more details

Parameter
Type
Description
TemplateContent
Required
EmailTemplateContent | undefined

The content of the email template, composed of a subject line, an HTML part, and a text-only part.

TemplateName
Required
string | undefined

The name of the template.

CreateEmailTemplateCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
AlreadyExistsException
client

The resource specified in your request already exists.

BadRequestException
client

The input you provided is invalid.

LimitExceededException
client

There are too many instances of the specified resource type.

TooManyRequestsException
client

Too many requests have been made to the operation.

SESv2ServiceException
Base exception class for all service exceptions from SESv2 service.