Registration fails silently when email already exists in Listmonk — user gets no invite email
## Bug When a user registers with an email that already exists as a Listmonk subscriber (e.g., from the landing page waitlist), the registration flow silently fails to link the Listmonk subscriber and skips the invite email. ## What happens 1. POST /api/subscribers returns 409 Conflict (email already exists in Listmonk) 2. create_subscriber treats any non-200/201 as ExternalServiceError 3. _subscribe_and_invite catches the exception, logs a warning, sets listmonk_id = None 4. Registration continues — user created in DB with listmonk_id = NULL ## Consequences 1. Invite email is NOT sent (skipped because listmonk_id is None) 2. app_user.listmonk_id is NULL — future transactional emails (notifications, deletion confirmations) can never be sent 3. The existing Listmonk subscriber ID is never linked to the app_user record 4. User has no way to know their registration is incomplete ## Fix Listmonk's API returns the existing subscriber data in the 409 response body. The fix: 1. In create_subscriber, check for 409 specifically 2. Parse the 409 response body to extract the existing subscriber ID 3. Return that ID instead of raising an error 4. _subscribe_and_invite gets a valid listmonk_id and proceeds normally (sends invite email) ```python # In create_subscriber: if response.status_code == 409: # Email already exists — extract existing subscriber ID from response existing = response.json().get('data', {}) return existing.get('id') # Return existing ID instead of failing ``` ## Impact Any user who was on the waitlist (subscribed via landing page) and then registers will hit this bug. They get a broken account with no email capability.
0 Comments
Sign in to comment
No comments yet. Be the first to share your thoughts!
