email_templates
Creates, updates, deletes, gets or lists an email_templates resource.
Overview
| Name | email_templates |
| Type | Resource |
| Id | aws.sesv2.email_templates |
Fields
The following fields are returned by SELECT queries:
- get_email_template
- list_email_templates
| Name | Datatype | Description |
|---|---|---|
tags | array | An array of objects that define the tags (keys and values) that are associated with the email template. |
template_content | object | The content of the email, composed of a subject line, an HTML part, and a text-only part. |
template_name | string | The name of the template. You will refer to this name when you send email using the SendEmail or SendBulkEmail operations. |
| Name | Datatype | Description |
|---|---|---|
next_token | string | A token indicating that there are additional email templates available to be listed. Pass this token to a subsequent ListEmailTemplates call to retrieve the next 10 email templates. |
templates_metadata | array | An array the contains the name and creation time stamp for each template in your Amazon SES account. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_email_template | select | template_name, region | 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. | |
list_email_templates | select | region | NextToken, PageSize | Lists 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_template | insert | region, TemplateName, TemplateContent | 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. | |
update_email_template | update | template_name, region, TemplateContent | 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. | |
delete_email_template | delete | template_name, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
template_name | string | The name of the template to be deleted. |
NextToken | string | A token returned from a previous call to ListEmailTemplates to indicate the position in the list of email templates. |
PageSize | integer | The 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
- get_email_template
- list_email_templates
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
;
Lists 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.
SELECT
next_token,
templates_metadata
FROM aws.sesv2.email_templates
WHERE region = '{{ region }}' -- required
AND NextToken = '{{ NextToken }}'
AND PageSize = '{{ PageSize }}'
;
INSERT examples
- create_email_template
- Manifest
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 }}'
;
# Description fields are for documentation purposes
- name: email_templates
props:
- name: region
value: "{{ region }}"
description: Required parameter for the email_templates resource.
- name: TemplateName
value: "{{ TemplateName }}"
description: |
The name of the template. You will refer to this name when you send email using the SendEmail or SendBulkEmail operations.
- name: TemplateContent
description: |
The content of the email, composed of a subject line, an HTML part, and a text-only part.
value:
Subject: "{{ Subject }}"
Text: "{{ Text }}"
Html: "{{ Html }}"
- name: Tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_email_template
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
- delete_email_template
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
;