push_templates
Creates, updates, deletes, gets or lists a push_templates resource.
Overview
| Name | push_templates |
| Type | Resource |
| Id | aws.pinpoint.push_templates |
Fields
The following fields are returned by SELECT queries:
- get_push_template
| Name | Datatype | Description |
|---|---|---|
adm | object | The message template that's used for the ADM (Amazon Device Messaging) channel. This message template overrides the default template for push notification channels (DefaultPushNotificationTemplate). |
apns | object | The message template that's used for the APNs (Apple Push Notification service) channel. This message template overrides the default template for push notification channels (DefaultPushNotificationTemplate). |
arn | string | The Amazon Resource Name (ARN) of the message template. |
baidu | object | The message template that's used for the Baidu (Baidu Cloud Push) channel. This message template overrides the default template for push notification channels (DefaultPushNotificationTemplate). |
creation_date | string | The date, in ISO 8601 format, when the message template was created. |
default | object | The default message template that's used for push notification channels. |
default_substitutions | string | The JSON object that specifies the default values that are used for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable. |
gcm | object | The message template that's used for the GCM channel, which is used to send notifications through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message template overrides the default template for push notification channels (DefaultPushNotificationTemplate). |
last_modified_date | string | The date, in ISO 8601 format, when the message template was last modified. |
recommender_id | string | The unique identifier for the recommender model that's used by the message template. |
template_description | string | The custom description of the message template. |
template_name | string | The name of the message template. |
template_type | string | The type of channel that the message template is designed for. For a push notification template, this value is PUSH. (EMAIL, SMS, VOICE, PUSH, INAPP) |
version | string | The unique identifier, as an integer, for the active version of the message template, or the version of the template that you specified by using the version parameter in your request. |
tags | object | A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. Each tag consists of a required tag key and an associated tag value. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_push_template | select | template-name, region | version | Retrieves the content and settings of a message template for messages that are sent through a push notification channel. |
create_push_template | insert | template-name, region, PushNotificationTemplateRequest | Creates a message template for messages that are sent through a push notification channel. | |
update_push_template | update | template-name, region, PushNotificationTemplateRequest | create-new-version, version | Updates an existing message template for messages that are sent through a push notification channel. |
delete_push_template | delete | template-name, region | version | Deletes a message template for messages that were sent through a push notification channel. |
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. |
create-new-version | boolean | Specifies whether to save the updates as a new version of the message template. Valid values are: true, save the updates as a new version; and, false, save the updates to (overwrite) the latest existing version of the template. If you don't specify a value for this parameter, Amazon Pinpoint saves the updates to (overwrites) the latest existing version of the template. If you specify a value of true for this parameter, don't specify a value for the version parameter. Otherwise, an error will occur. |
version | string | The unique identifier for the version of the message template to update, retrieve information about, or delete. To retrieve identifiers and other information for all the versions of a template, use the Template Versions resource. If specified, this value must match the identifier for an existing template version. If specified for an update operation, this value must match the identifier for the latest existing version of the template. This restriction helps ensure that race conditions don't occur. If you don't specify a value for this parameter, Amazon Pinpoint does the following: For a get operation, retrieves information about the active version of the template. For an update operation, saves the updates to (overwrites) the latest existing version of the template, if the create-new-version parameter isn't used or is set to false. For a delete operation, deletes the template, including all versions of the template. |
SELECT examples
- get_push_template
Retrieves the content and settings of a message template for messages that are sent through a push notification channel.
SELECT
adm,
apns,
arn,
baidu,
creation_date,
default,
default_substitutions,
gcm,
last_modified_date,
recommender_id,
template_description,
template_name,
template_type,
version,
tags
FROM aws.pinpoint.push_templates
WHERE `template-name` = '{{ template-name }}' -- required
AND region = '{{ region }}' -- required
AND version = '{{ version }}'
;
INSERT examples
- create_push_template
- Manifest
Creates a message template for messages that are sent through a push notification channel.
INSERT INTO aws.pinpoint.push_templates (
PushNotificationTemplateRequest,
`template-name`,
region
)
SELECT
'{{ PushNotificationTemplateRequest }}' /* required */,
'{{ template-name }}',
'{{ region }}'
RETURNING
create_template_message_body
;
# Description fields are for documentation purposes
- name: push_templates
props:
- name: template-name
value: "{{ template-name }}"
description: Required parameter for the push_templates resource.
- name: region
value: "{{ region }}"
description: Required parameter for the push_templates resource.
- name: PushNotificationTemplateRequest
description: |
Specifies the content and settings for a message template that can be used in messages that are sent through a push notification channel.
value:
ADM:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
RawContent: "{{ RawContent }}"
SmallImageIconUrl: "{{ SmallImageIconUrl }}"
Sound: "{{ Sound }}"
Title: "{{ Title }}"
Url: "{{ Url }}"
APNS:
Action: "{{ Action }}"
Body: "{{ Body }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
Sound: "{{ Sound }}"
Title: "{{ Title }}"
Url: "{{ Url }}"
Baidu:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
RawContent: "{{ RawContent }}"
SmallImageIconUrl: "{{ SmallImageIconUrl }}"
Sound: "{{ Sound }}"
Title: "{{ Title }}"
Url: "{{ Url }}"
Default:
Action: "{{ Action }}"
Body: "{{ Body }}"
Sound: "{{ Sound }}"
Title: "{{ Title }}"
Url: "{{ Url }}"
DefaultSubstitutions: "{{ DefaultSubstitutions }}"
GCM:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
RawContent: "{{ RawContent }}"
SmallImageIconUrl: "{{ SmallImageIconUrl }}"
Sound: "{{ Sound }}"
Title: "{{ Title }}"
Url: "{{ Url }}"
RecommenderId: "{{ RecommenderId }}"
tags: "{{ tags }}"
TemplateDescription: "{{ TemplateDescription }}"
UPDATE examples
- update_push_template
Updates an existing message template for messages that are sent through a push notification channel.
UPDATE aws.pinpoint.push_templates
SET
PushNotificationTemplateRequest = '{{ PushNotificationTemplateRequest }}'
WHERE
`template-name` = '{{ template-name }}' --required
AND region = '{{ region }}' --required
AND PushNotificationTemplateRequest = '{{ PushNotificationTemplateRequest }}' --required
AND `create-new-version` = {{ create-new-version}}
AND version = '{{ version}}'
RETURNING
message_body;
DELETE examples
- delete_push_template
Deletes a message template for messages that were sent through a push notification channel.
DELETE FROM aws.pinpoint.push_templates
WHERE `template-name` = '{{ template-name }}' --required
AND region = '{{ region }}' --required
AND version = '{{ version }}'
;