diff --git a/app/main.py b/app/main.py index 9adb527..6bb6b3b 100644 --- a/app/main.py +++ b/app/main.py @@ -482,10 +482,13 @@ async def listmonk_reconcile() -> dict: # Both classes leave the list the same way: unsubscribe, keep the # record. Nothing is deleted. reason = "inactive member" if email in member_emails else "not a member" + # listmonk validates the PUT body's email field: omitting it is a + # 400 "Invalid email." and the subscriber stays on the list (which + # is why the inactive-member branch never actually worked). r = await client.put( f"{LISTMONK_BASE}/api/subscribers/{sid}", headers=auth, - json={"lists": []}, + json={"email": s.get("email"), "lists": []}, ) if r.status_code in (200, 201): removed += 1