Skip to main content

email_templates

Creates, updates, deletes, gets or lists an email_templates resource.

Overview

Nameemail_templates
TypeResource
Idaws.sesv2.email_templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
tagsarrayAn array of objects that define the tags (keys and values) that are associated with the email template.
template_contentobjectThe content of the email, composed of a subject line, an HTML part, and a text-only part.
template_namestringThe name of the template. You will refer to this name when you send email using the SendEmail or SendBulkEmail operations.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_email_templateselecttemplate_name, regionDisplays 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 50 times per second.
list_email_templatesselectregionNextToken, PageSizeLists the email templates present in your Amazon SES account in the current Amazon Web Services Region. You can execute this operation no more than once per second.
create_email_templateinsertregion, TemplateName, TemplateContentCreates 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.
update_email_templateupdatetemplate_name, region, TemplateContentUpdates 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.
delete_email_templatedeletetemplate_name, regionDeletes an email template. You can execute this operation no more than once per second.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
template_namestringThe name of the template to be deleted.
NextTokenstringA token returned from a previous call to ListEmailTemplates to indicate the position in the list of email templates.
PageSizeintegerThe number of results to show in a single call to ListEmailTemplates. If the number of results is larger than the number you specified in this parameter, then the response includes a NextToken element, which you can use to obtain additional results. The value you specify has to be at least 1, and can be no more than 100.

SELECT examples

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 50 times per second.

SELECT
tags,
template_content,
template_name
FROM aws.sesv2.email_templates
WHERE template_name = '{{ template_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.sesv2.email_templates (
TemplateName,
TemplateContent,
Tags,
region
)
SELECT
'{{ TemplateName }}' /* required */,
'{{ TemplateContent }}' /* required */,
'{{ Tags }}',
'{{ region }}'
;

UPDATE examples

Updates 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.

UPDATE aws.sesv2.email_templates
SET
TemplateContent = '{{ TemplateContent }}'
WHERE
template_name = '{{ template_name }}' --required
AND region = '{{ region }}' --required
AND TemplateContent = '{{ TemplateContent }}' --required;

DELETE examples

Deletes an email template. You can execute this operation no more than once per second.

DELETE FROM aws.sesv2.email_templates
WHERE template_name = '{{ template_name }}' --required
AND region = '{{ region }}' --required
;