-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws sesv2 list-contacts
returns an empty result when filtering with FilteredStatus=OPT_OUT
#8742
Comments
aws sesv2 list-contacts
returns an empty result when filtering with FilteredStatus=OPT_OUT
(short issue description)aws sesv2 list-contacts
returns an empty result when filtering with FilteredStatus=OPT_OUT
Hi @delhi09, thanks for reaching out. Since you received a |
Hi @RyanFitzSimmonsAK , thank you for your suggestion. I tried it, but unfortunately, it didn't change the result.
|
What if you continue to paginate using the |
Hi @RyanFitzSimmonsAK , I apologize for the delay in my response. Thank you for your suggestion. I tried pagination 10 times as follows. However, the "Contacts" field was empty in all results.
|
Are you paginating until there isn't a |
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one. |
Hi @RyanFitzSimmonsAK , thank you for your suggestion. I created the following Python script and verified your suggestion. import subprocess
import json
import time
request_count = 0
cmd = [
"aws",
"sesv2",
"list-contacts",
"--contact-list-name=TestContactList",
"--filter=FilteredStatus=OPT_OUT,TopicFilter={TopicName=test-topic,UseDefaultIfPreferenceUnavailable=true}",
"--region",
"us-east-1",
]
output = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = output.stdout.decode("utf-8")
next_token = json.loads(result)["NextToken"]
request_count += 1
while True:
time.sleep(5)
cmd = [
"aws",
"sesv2",
"list-contacts",
"--contact-list-name=TestContactList",
"--filter=FilteredStatus=OPT_OUT,TopicFilter={TopicName=test-topic,UseDefaultIfPreferenceUnavailable=true}",
"--region",
"us-east-1",
"--next-token",
next_token,
]
output = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = json.loads(output.stdout.decode("utf-8"))
next_token = result["NextToken"]
request_count += 1
print("request count: ", request_count, "contacts: ", result["Contacts"], "next_token: ", next_token[0:10])
if "NextToken" not in result or not result["NextToken"]:
break
print("finished. request count: ", request_count) I aborted the script because it seemed like it was going to run indefinitely. Generally, the results showed contacts are empty, but there were a few instances where email addresses were found on some pages. Could you please explain how this is supposed to work? console log1
console log2
|
Thanks for your patience. Could you try increasing the |
Thank you for your suggestion. I increased the Initially, I assumed that the
However, based on your advice and the results of my tests, I now understand that it works the other way around: the pagination happens first, and only then the results are filtered. My goal is to retrieve a list of email addresses that have opted out, but given this behavior, it seems difficult to achieve that using the list-contacts command. Do you know of any more efficient method for this? If not, I understand the current limitations of the Thanks again! |
I'm not sure if there's an efficient workaround. I've reached out to the service team about this, and will let you know when I have an update. Ticket # for internal use : P156959491 |
The service team has acknowledged this behavior, and confirmed that pagination taking place before filtering is intended. At this time, there is not a workaround for your specific use case. I've asked them to document this nuance. Thanks again for opening this issue. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
I would like to count OPT_OUT emails in the list management of AWS SES.
I confirmed at least one OPT_OUT email exists using the following command:
However, the following command always returns an empty result:
When
FilteredStatus=OPT_IN
, the command successfully returns OPT_IN emails as follows:Expected Behavior
OPT_OUT emails should be returned as follows:
Current Behavior
As described in the "Describe the bug" section.
Reproduction Steps
1.Send an email using the SESv2 API with ListManagementOptions:
2.Receive the email in a Gmail client and click the "Unsubscribe" link.
3.Confirm "[email protected]" is saved as
OPT_OUT
using the following command:OPT_OUT
emails using the following command. It will probably return an empty result:Possible Solution
No response
Additional Information/Context
No response
CLI version used
aws-cli/2.16.7 Python/3.11.8 Darwin/23.4.0 exe/x86_64
Environment details (OS name and version, etc.)
macOS 14.4.1
The text was updated successfully, but these errors were encountered: