TestRenderEmailTemplateCommand

Creates a preview of the MIME content of an email when provided with a template and a set of replacement data.

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, TestRenderEmailTemplateCommand } from "@aws-sdk/client-sesv2"; // ES Modules import
// const { SESv2Client, TestRenderEmailTemplateCommand } = require("@aws-sdk/client-sesv2"); // CommonJS import
const client = new SESv2Client(config);
const input = { // TestRenderEmailTemplateRequest
  TemplateName: "STRING_VALUE", // required
  TemplateData: "STRING_VALUE", // required
};
const command = new TestRenderEmailTemplateCommand(input);
const response = await client.send(command);
// { // TestRenderEmailTemplateResponse
//   RenderedTemplate: "STRING_VALUE", // required
// };

TestRenderEmailTemplateCommand Input

Parameter
Type
Description
TemplateData
Required
string | undefined

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.

TemplateName
Required
string | undefined

The name of the template.

TestRenderEmailTemplateCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
RenderedTemplate
Required
string | undefined

The complete MIME message rendered by applying the data in the TemplateData parameter to the template specified in the TemplateName parameter.

Throws

Name
Fault
Details
BadRequestException
client

The input you provided is invalid.

NotFoundException
client

The resource you attempted to access doesn't exist.

TooManyRequestsException
client

Too many requests have been made to the operation.

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