contacts
Creates, updates, deletes, gets or lists a contacts resource.
Overview
| Name | contacts |
| Type | Resource |
| Id | aws.sesv2.contacts |
Fields
The following fields are returned by SELECT queries:
- get_contact
- list_contacts
| Name | Datatype | Description |
|---|---|---|
attributes_data | string | The attribute data attached to a contact. |
contact_list_name | string | The name of the contact list to which the contact belongs. |
created_timestamp | string (date-time) | A timestamp noting when the contact was created. |
email_address | string | The contact's email address. |
last_updated_timestamp | string (date-time) | A timestamp noting the last time the contact's information was updated. |
topic_default_preferences | array | The default topic preferences applied to the contact. |
topic_preferences | array | The contact's preference for being opted-in to or opted-out of a topic.> |
unsubscribe_all | boolean | A boolean value status noting if the contact is unsubscribed from all contact list topics. |
| Name | Datatype | Description |
|---|---|---|
contacts | array | The contacts present in a specific contact list. |
next_token | string | A string token indicating that there might be additional contacts available to be listed. Copy this token to a subsequent call to ListContacts with the same parameters to retrieve the next page of contacts. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_contact | select | contact_list_name, email_address, region | Returns a contact from a contact list. | |
list_contacts | select | contact_list_name, region | Lists the contacts present in a specific contact list. | |
create_contact | insert | contact_list_name, region, EmailAddress | Creates a contact, which is an end-user who is receiving the email, and adds them to a contact list. | |
update_contact | update | contact_list_name, email_address, region | Updates a contact's preferences for a list. You must specify all existing topic preferences in the TopicPreferences object, not just the ones that need updating; otherwise, all your existing preferences will be removed. | |
delete_contact | delete | contact_list_name, email_address, region | Removes a contact from a contact list. |
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 |
|---|---|---|
contact_list_name | string | The name of the contact list from which the contact should be removed. |
email_address | string | The contact's email address. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_contact
- list_contacts
Returns a contact from a contact list.
SELECT
attributes_data,
contact_list_name,
created_timestamp,
email_address,
last_updated_timestamp,
topic_default_preferences,
topic_preferences,
unsubscribe_all
FROM aws.sesv2.contacts
WHERE contact_list_name = '{{ contact_list_name }}' -- required
AND email_address = '{{ email_address }}' -- required
AND region = '{{ region }}' -- required
;
Lists the contacts present in a specific contact list.
SELECT
contacts,
next_token
FROM aws.sesv2.contacts
WHERE contact_list_name = '{{ contact_list_name }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_contact
- Manifest
Creates a contact, which is an end-user who is receiving the email, and adds them to a contact list.
INSERT INTO aws.sesv2.contacts (
EmailAddress,
TopicPreferences,
UnsubscribeAll,
AttributesData,
contact_list_name,
region
)
SELECT
'{{ EmailAddress }}' /* required */,
'{{ TopicPreferences }}',
{{ UnsubscribeAll }},
'{{ AttributesData }}',
'{{ contact_list_name }}',
'{{ region }}'
;
# Description fields are for documentation purposes
- name: contacts
props:
- name: contact_list_name
value: "{{ contact_list_name }}"
description: Required parameter for the contacts resource.
- name: region
value: "{{ region }}"
description: Required parameter for the contacts resource.
- name: EmailAddress
value: "{{ EmailAddress }}"
- name: TopicPreferences
value:
- TopicName: "{{ TopicName }}"
SubscriptionStatus: "{{ SubscriptionStatus }}"
- name: UnsubscribeAll
value: {{ UnsubscribeAll }}
- name: AttributesData
value: "{{ AttributesData }}"
UPDATE examples
- update_contact
Updates a contact's preferences for a list. You must specify all existing topic preferences in the TopicPreferences object, not just the ones that need updating; otherwise, all your existing preferences will be removed.
UPDATE aws.sesv2.contacts
SET
TopicPreferences = '{{ TopicPreferences }}',
UnsubscribeAll = {{ UnsubscribeAll }},
AttributesData = '{{ AttributesData }}'
WHERE
contact_list_name = '{{ contact_list_name }}' --required
AND email_address = '{{ email_address }}' --required
AND region = '{{ region }}' --required;
DELETE examples
- delete_contact
Removes a contact from a contact list.
DELETE FROM aws.sesv2.contacts
WHERE contact_list_name = '{{ contact_list_name }}' --required
AND email_address = '{{ email_address }}' --required
AND region = '{{ region }}' --required
;