Compare commits

...

2 commits

Author SHA1 Message Date
j
55202ba3b0 delete bounced emails 2023-09-29 13:20:09 +02:00
j
1e0e428037 add image 2023-09-28 15:53:05 +02:00
2 changed files with 13 additions and 0 deletions

View file

@ -77,3 +77,16 @@ def add_email(email):
return False return False
return False return False
def delete_bounced_emails():
url = settings.LISTMONK_API + 'bounces'
auth = (settings.LISTMONK_USER, settings.LISTMONK_PASSWORD)
r = requests.get(url + '?per_page=10000', auth=auth)
ids = [sub['subscriber_id'] for sub in r['data']['results']]
url = settings.LISTMONK_API + 'subscribers'
for id in ids:
r = requests.delete(url + '?id=%s' % id, auth=auth).json()
if not r.get("data"):
print(id)

BIN
app/static/jpg/icon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB