Guide
How to create an Amazon SES email template.
Last updated 11 November 2026
A stored SES template is a subject, a text body, and an HTML body saved under a name in your SES account. Here’s how to create one from the command line, in code, or as infrastructure, with each step checked against the AWS documentation.
Skip the JSON
Design the template with blocks, preview it with sample data, and publish it to your SES account.
Open the editorBefore you start
- Stored or inline. A stored template is saved in SES and sent by name. An inline template travels in the send call and isn’t saved. This guide covers stored templates. AWS describes both in Using templates to send personalized email.
- Region. Templates are listed per AWS Region, so create the template in the Region you send from.
- Limits. You can create up to 20,000 templates in each Region, and each can be up to 500 KB including the text and HTML parts.
Write the template JSON
A template has a name and three content parts:
{
"TemplateName": "welcome",
"TemplateContent": {
"Subject": "Welcome, {{firstName}}",
"Text": "Hi {{firstName}},\r\nYour account is ready.",
"Html": "<h1>Hi {{firstName}}</h1><p>Your account is ready.</p>"
}
}TemplateNameis the name you refer to when you send.Subject,Html, andTextcan each contain replacement tags such as{{firstName}}. You give each tag a value when you send.Textis shown to recipients whose email clients don’t display HTML.
The HTML has to sit on one line as an escaped JSON string. AWS notes that the values can’t contain line breaks in the JSON file. Stored templates also support Handlebars features such as nested attributes, loops, conditions, and inline partials (Advanced email personalization). See the SES Handlebars reference.
Create it with the AWS CLI
Save the JSON as welcome.json and run:
aws sesv2 create-email-template --cli-input-json file://welcome.jsonA successful call returns nothing. The CreateEmailTemplate reference lists the errors you can get back:
| Error | Meaning |
|---|---|
AlreadyExistsException | A template with that name already exists |
BadRequestException | The input is invalid |
LimitExceededException | There are too many templates |
TooManyRequestsException | Too many requests. You can run this operation no more than once per second |
Create it with an SDK
The SDKs call the same operation. Node.js:
import { SESv2Client, CreateEmailTemplateCommand } from '@aws-sdk/client-sesv2';
const ses = new SESv2Client({ region: 'us-east-1' });
await ses.send(new CreateEmailTemplateCommand({
TemplateName: 'welcome',
TemplateContent: {
Subject: 'Welcome, {{firstName}}',
Text: 'Hi {{firstName}},\r\nYour account is ready.',
Html: '<h1>Hi {{firstName}}</h1><p>Your account is ready.</p>',
},
}));Python:
import boto3
ses = boto3.client('sesv2', region_name='us-east-1')
ses.create_email_template(
TemplateName='welcome',
TemplateContent={
'Subject': 'Welcome, {{firstName}}',
'Text': 'Hi {{firstName}},\r\nYour account is ready.',
'Html': '<h1>Hi {{firstName}}</h1><p>Your account is ready.</p>',
},
)An SDK encodes the strings for you, so you can read the HTML from a file instead of escaping it by hand.
Create it with CloudFormation
CloudFormation has an AWS::SES::Template resource. Its property names differ from the v2 API: SubjectPart, TextPart, and HtmlPart.
Resources:
WelcomeTemplate:
Type: AWS::SES::Template
Properties:
Template:
TemplateName: welcome
SubjectPart: 'Welcome, {{firstName}}'
TextPart: "Hi {{firstName}},\r\nYour account is ready."
HtmlPart: '<h1>Hi {{firstName}}</h1><p>Your account is ready.</p>'Per the property reference, SubjectPart is required, and TemplateName can be 1 to 64 letters, numbers, underscores, or hyphens. Changing TemplateName replaces the resource. Changing the other parts updates it in place.
Check and send
Read the template back, then render it with sample data:
aws sesv2 get-email-template --template-name welcome
aws sesv2 test-render-email-template \
--template-name welcome \
--template-data '{"firstName":"Ada"}'To send, call SendEmail or SendBulkEmail with the template name and the data. AWS recommends a configuration set that publishes Rendering Failure events, because SES might accept a message with invalid personalization content and then not deliver it. More in how to test SES templates and SES template rendering failures. To change the template later, see how to edit SES templates.
Create it visually
Huskar Templates is a visual editor for SES templates. Start from a blank canvas or a starter, design with blocks, and add conditions and loops that stay real Handlebars. Preview with sample data in Gmail, Apple Mail, and Outlook frames. Publish creates the template in your SES account through an IAM role you control, and you can export the SES template JSON at any time.
You can try the editor in your browser without an account, or start from one of the free SES email templates. The email template generator restyles the whole set with your colours and logo and downloads it as ready-to-upload SES JSON.
FAQ
How do I create an email template in Amazon SES?
Write a JSON file with a TemplateName and a TemplateContent object holding Subject, Text, and Html, then run aws sesv2 create-email-template --cli-input-json file://yourfile.json. The same CreateEmailTemplate operation is available in the AWS SDKs, and CloudFormation has an AWS::SES::Template resource.
What happens if a template with that name already exists?
CreateEmailTemplate returns AlreadyExistsException. Use UpdateEmailTemplate to change an existing template, or pick another name.
How many SES templates can I create?
Up to 20,000 stored email templates in each AWS Region. Each can be up to 500 KB, including both the text and HTML parts. CreateEmailTemplate returns LimitExceededException when there are too many.
Do I have to create a stored template to send templated email?
No. SES also accepts inline templates, where the subject and body with their placeholders are passed in the SendEmail or SendBulkEmail call. Inline templates do not count against the 20,000-template limit, and each input JSON file can be up to 1 MB.