Skip to main content

templates

Creates, updates, deletes, gets or lists a templates resource.

Overview

Nametemplates
TypeResource
Idaws.ses.templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
html_partstringThe HTML body of the email.
subject_partstringThe subject line of the email.
template_namestringThe name of the template. You use this name when you send email using the SendTemplatedEmail or SendBulkTemplatedEmail operations.
text_partstringThe email body that is visible to recipients whose email clients do not display HTML content.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_templateselectTemplateName, 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 once per second.
list_templatesselectregionNextToken, MaxItemsLists 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_templateinsertTemplate, regionCreates an email template. Email templates enable you to send personalized email to one or more destinations in a single operation. For more information, see the Amazon SES Developer Guide. You can execute this operation no more than once per second.
update_templateupdateTemplate, regionUpdates an email template. Email templates enable you to send personalized email to one or more destinations in a single operation. For more information, see the Amazon SES Developer Guide. You can execute this operation no more than once per second.
delete_templatedeleteTemplateName, regionDeletes an email template. You can execute this operation no more than once per second.
send_custom_verification_emailexecEmailAddress, TemplateName, regionConfigurationSetNameAdds an email address to the list of identities for your Amazon SES account in the current Amazon Web Services Region and attempts to verify it. As a result of executing this operation, a customized verification email is sent to the specified address. To use this operation, you must first create a custom verification email template. For more information about creating and using custom verification email templates, see Using Custom Verification Email Templates in the Amazon SES Developer Guide. You can execute this operation no more than once per second.
test_render_templateexecTemplateName, TemplateData, regionCreates 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.

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
EmailAddressstringThe email address to verify.
Templateobject
TemplateDatastringA 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.
TemplateNamestringThe name of the template to render.
regionstringAWS region (default: us-east-1)
ConfigurationSetNamestringName of a configuration set to use when sending the verification email.
MaxItemsintegerThe maximum number of templates to return. This value must be at least 1 and less than or equal to 100. If more than 100 items are requested, the page size will automatically set to 100. If you do not specify a value, 10 is the default page size.
NextTokenstringA token returned from a previous call to ListTemplates to indicate the position in the list of email templates.

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 once per second.

SELECT
html_part,
subject_part,
template_name,
text_part
FROM aws.ses.templates
WHERE TemplateName = '{{ TemplateName }}' -- 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 operation. For more information, see the Amazon SES Developer Guide. You can execute this operation no more than once per second.

INSERT INTO aws.ses.templates (
Template,
region
)
SELECT
'{{ Template }}',
'{{ region }}'
;

UPDATE examples

Updates an email template. Email templates enable you to send personalized email to one or more destinations in a single operation. For more information, see the Amazon SES Developer Guide. You can execute this operation no more than once per second.

UPDATE aws.ses.templates
SET
-- No updatable properties
WHERE
Template = '{{ Template }}' --required
AND region = '{{ region }}' --required;

DELETE examples

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

DELETE FROM aws.ses.templates
WHERE TemplateName = '{{ TemplateName }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Adds an email address to the list of identities for your Amazon SES account in the current Amazon Web Services Region and attempts to verify it. As a result of executing this operation, a customized verification email is sent to the specified address. To use this operation, you must first create a custom verification email template. For more information about creating and using custom verification email templates, see Using Custom Verification Email Templates in the Amazon SES Developer Guide. You can execute this operation no more than once per second.

EXEC aws.ses.templates.send_custom_verification_email
@EmailAddress='{{ EmailAddress }}' --required,
@TemplateName='{{ TemplateName }}' --required,
@region='{{ region }}' --required,
@ConfigurationSetName='{{ ConfigurationSetName }}'
;