- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetTemplateCommand
Displays the template object (which includes the Subject line, HTML part and text part) for the template you specify.
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 { SESClient, GetTemplateCommand } from "@aws-sdk/client-ses"; // ES Modules import
// const { SESClient, GetTemplateCommand } = require("@aws-sdk/client-ses"); // CommonJS import
const client = new SESClient(config);
const input = { // GetTemplateRequest
TemplateName: "STRING_VALUE", // required
};
const command = new GetTemplateCommand(input);
const response = await client.send(command);
// { // GetTemplateResponse
// Template: { // Template
// TemplateName: "STRING_VALUE", // required
// SubjectPart: "STRING_VALUE",
// TextPart: "STRING_VALUE",
// HtmlPart: "STRING_VALUE",
// },
// };
GetTemplateCommand Input
See GetTemplateCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
TemplateName Required | string | undefined | The name of the template to retrieve. |
GetTemplateCommand Output
See GetTemplateCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Template | Template | undefined | The content of the email, composed of a subject line and either an HTML part or a text-only part. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
TemplateDoesNotExistException | client | Indicates that the Template object you specified does not exist in your Amazon SES account. |
SESServiceException | Base exception class for all service exceptions from SES service. |