in_app_templates
Creates, updates, deletes, gets or lists an in_app_templates resource.
Overview
| Name | in_app_templates |
| Type | Resource |
| Id | aws.pinpoint.in_app_templates |
Fields
The following fields are returned by SELECT queries:
- get_in_app_template
| Name | Datatype | Description |
|---|---|---|
arn | string | The resource arn of the template. |
content | array | The content of the message, can include up to 5 modals. Each modal must contain a message, a header, and background color. ImageUrl and buttons are optional. |
creation_date | string | The creation date of the template. |
custom_config | object | Custom config to be sent to client. |
last_modified_date | string | The last modified date of the template. |
layout | string | The layout of the message. (BOTTOM_BANNER, TOP_BANNER, OVERLAYS, MOBILE_FEED, MIDDLE_BANNER, CAROUSEL) |
template_description | string | The description of the template. |
template_name | string | The name of the template. |
template_type | string | The type of the template. (EMAIL, SMS, VOICE, PUSH, INAPP) |
version | string | The version id of the template. |
tags | object | A string-to-string map of key-value pairs that defines the tags to associate 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_in_app_template | select | template-name, region | version | Retrieves the content and settings of a message template for messages sent through the in-app channel. |
create_in_app_template | insert | template-name, region, InAppTemplateRequest | Creates a new message template for messages using the in-app message channel. | |
update_in_app_template | update | template-name, region, InAppTemplateRequest | create-new-version, version | Updates an existing message template for messages sent through the in-app message channel. |
delete_in_app_template | delete | template-name, region | version | Deletes a message template for messages sent using the in-app message 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_in_app_template
Retrieves the content and settings of a message template for messages sent through the in-app channel.
SELECT
arn,
content,
creation_date,
custom_config,
last_modified_date,
layout,
template_description,
template_name,
template_type,
version,
tags
FROM aws.pinpoint.in_app_templates
WHERE `template-name` = '{{ template-name }}' -- required
AND region = '{{ region }}' -- required
AND version = '{{ version }}'
;
INSERT examples
- create_in_app_template
- Manifest
Creates a new message template for messages using the in-app message channel.
INSERT INTO aws.pinpoint.in_app_templates (
InAppTemplateRequest,
`template-name`,
region
)
SELECT
'{{ InAppTemplateRequest }}' /* required */,
'{{ template-name }}',
'{{ region }}'
RETURNING
template_create_message_body
;
# Description fields are for documentation purposes
- name: in_app_templates
props:
- name: template-name
value: "{{ template-name }}"
description: Required parameter for the in_app_templates resource.
- name: region
value: "{{ region }}"
description: Required parameter for the in_app_templates resource.
- name: InAppTemplateRequest
description: |
InApp Template Request.
value:
Content:
- BackgroundColor: "{{ BackgroundColor }}"
BodyConfig:
Alignment: "{{ Alignment }}"
Body: "{{ Body }}"
TextColor: "{{ TextColor }}"
HeaderConfig:
Alignment: "{{ Alignment }}"
Header: "{{ Header }}"
TextColor: "{{ TextColor }}"
ImageUrl: "{{ ImageUrl }}"
PrimaryBtn:
Android:
ButtonAction: "{{ ButtonAction }}"
Link: "{{ Link }}"
DefaultConfig:
BackgroundColor: "{{ BackgroundColor }}"
BorderRadius: {{ BorderRadius }}
ButtonAction: "{{ ButtonAction }}"
Link: "{{ Link }}"
Text: "{{ Text }}"
TextColor: "{{ TextColor }}"
IOS:
ButtonAction: "{{ ButtonAction }}"
Link: "{{ Link }}"
Web:
ButtonAction: "{{ ButtonAction }}"
Link: "{{ Link }}"
SecondaryBtn:
Android:
ButtonAction: "{{ ButtonAction }}"
Link: "{{ Link }}"
DefaultConfig:
BackgroundColor: "{{ BackgroundColor }}"
BorderRadius: {{ BorderRadius }}
ButtonAction: "{{ ButtonAction }}"
Link: "{{ Link }}"
Text: "{{ Text }}"
TextColor: "{{ TextColor }}"
IOS:
ButtonAction: "{{ ButtonAction }}"
Link: "{{ Link }}"
Web:
ButtonAction: "{{ ButtonAction }}"
Link: "{{ Link }}"
CustomConfig: "{{ CustomConfig }}"
Layout: "{{ Layout }}"
tags: "{{ tags }}"
TemplateDescription: "{{ TemplateDescription }}"
UPDATE examples
- update_in_app_template
Updates an existing message template for messages sent through the in-app message channel.
UPDATE aws.pinpoint.in_app_templates
SET
InAppTemplateRequest = '{{ InAppTemplateRequest }}'
WHERE
`template-name` = '{{ template-name }}' --required
AND region = '{{ region }}' --required
AND InAppTemplateRequest = '{{ InAppTemplateRequest }}' --required
AND `create-new-version` = {{ create-new-version}}
AND version = '{{ version}}'
RETURNING
message_body;
DELETE examples
- delete_in_app_template
Deletes a message template for messages sent using the in-app message channel.
DELETE FROM aws.pinpoint.in_app_templates
WHERE `template-name` = '{{ template-name }}' --required
AND region = '{{ region }}' --required
AND version = '{{ version }}'
;