Skip to main content

templates

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

Overview

Nametemplates
TypeResource
Idaws.pinpoint.templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
itemarrayAn array of responses, one for each message template that's associated with your Amazon Pinpoint account and meets any filter criteria that you specified in the request.
next_tokenstringThe string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_templatesselectregionnext-token, page-size, prefix, template-typeRetrieves information about all the message templates that are associated with your Amazon Pinpoint account.
update_template_active_versionupdatetemplate-name, template-type, region, TemplateActiveVersionRequestChanges the status of a specific version of a message template to active.

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 message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
template-typestringThe type of channel that the message template is designed for. Valid values are: EMAIL, PUSH, SMS, and VOICE.
next-tokenstringThe string that specifies which page of results to return in a paginated response. This parameter is not supported for application, campaign, and journey metrics.
page-sizestringThe maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics.
prefixstringThe substring to match in the names of the message templates to include in the results. If you specify this value, Amazon Pinpoint returns only those templates whose names begin with the value that you specify.
template-typestringThe type of message template to include in the results. Valid values are: EMAIL, PUSH, SMS, and VOICE. To include all types of templates in the results, don't include this parameter in your request.

SELECT examples

Retrieves information about all the message templates that are associated with your Amazon Pinpoint account.

SELECT
item,
next_token
FROM aws.pinpoint.templates
WHERE region = '{{ region }}' -- required
AND `next-token` = '{{ next-token }}'
AND `page-size` = '{{ page-size }}'
AND prefix = '{{ prefix }}'
AND `template-type` = '{{ template-type }}'
;

UPDATE examples

Changes the status of a specific version of a message template to active.

UPDATE aws.pinpoint.templates
SET
TemplateActiveVersionRequest = '{{ TemplateActiveVersionRequest }}'
WHERE
`template-name` = '{{ template-name }}' --required
AND `template-type` = '{{ template-type }}' --required
AND region = '{{ region }}' --required
AND TemplateActiveVersionRequest = '{{ TemplateActiveVersionRequest }}' --required
RETURNING
message_body;