Skip to main content

contacts

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

Overview

Namecontacts
TypeResource
Idaws.sesv2.contacts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
attributes_datastringThe attribute data attached to a contact.
contact_list_namestringThe name of the contact list to which the contact belongs.
created_timestampstring (date-time)A timestamp noting when the contact was created.
email_addressstringThe contact's email address.
last_updated_timestampstring (date-time)A timestamp noting the last time the contact's information was updated.
topic_default_preferencesarrayThe default topic preferences applied to the contact.
topic_preferencesarrayThe contact's preference for being opted-in to or opted-out of a topic.>
unsubscribe_allbooleanA boolean value status noting if the contact is unsubscribed from all contact list topics.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_contactselectcontact_list_name, email_address, regionReturns a contact from a contact list.
list_contactsselectcontact_list_name, regionLists the contacts present in a specific contact list.
create_contactinsertcontact_list_name, region, EmailAddressCreates a contact, which is an end-user who is receiving the email, and adds them to a contact list.
update_contactupdatecontact_list_name, email_address, regionUpdates 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_contactdeletecontact_list_name, email_address, regionRemoves 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.

NameDatatypeDescription
contact_list_namestringThe name of the contact list from which the contact should be removed.
email_addressstringThe contact's email address.
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

INSERT examples

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 }}'
;

UPDATE examples

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

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
;