templates
Creates, updates, deletes, gets or lists a templates resource.
Overview
| Name | templates |
| Type | Resource |
| Id | aws.pinpoint.templates |
Fields
The following fields are returned by SELECT queries:
- list_templates
| Name | Datatype | Description |
|---|---|---|
item | array | An 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_token | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_templates | select | region | next-token, page-size, prefix, template-type | Retrieves information about all the message templates that are associated with your Amazon Pinpoint account. |
update_template_active_version | update | template-name, template-type, region, TemplateActiveVersionRequest | Changes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
template-name | string | The 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-type | string | The type of channel that the message template is designed for. Valid values are: EMAIL, PUSH, SMS, and VOICE. |
next-token | string | The 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-size | string | The maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics. |
prefix | string | The 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-type | string | The 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
- list_templates
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
- update_template_active_version
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;