Skip to content

Signing up for Discord? Some of our domains are accepted there. See which ones on the Domains page.

CyberTemp
All posts

How to Test Waitlist and Queue-Position Emails

CyberTemp7 min read

Need a disposable inbox right now?

Spin up a temporary email address in seconds — no signup, no spam, no trace.

Get a free inbox

Waitlist emails look simple until you actually have to test one. A signup confirmation is a fixed string. A queue-position email has a number that changes every time someone else joins or drops out, an ETA that depends on your throughput assumptions, and usually a second email type entirely for "you moved up because you referred someone." Most teams test the first email in the sequence and ship, then find out in production that position 4,812 sent an access-granted email to someone still 3,000 people back.

Here's how to build a real test harness for waitlist and queue-position emails using disposable inboxes, so the bugs show up in CI instead of in a support ticket.


Why queue-position emails are a different testing problem

A normal transactional email — password reset, order receipt — is deterministic. Same input, same output, every time. You can write one test, assert on one string, and move on.

A queue-position email is stateful. The number in the email depends on how many other people are ahead of the test account at the moment the email renders, which depends on your queue-processing job, which depends on whatever other signups happened in the same test run. If your test suite creates users serially and checks the queue count synchronously, you'll get a passing test that has never actually verified the number a real user would see, because your test account was always alone in the queue.

The bugs that actually reach production are the ones that only show up under concurrency: two signups landing in the same processing window and both getting told they're "next," a referral bump that recalculates position for the wrong user, or a queue count that includes people who already unsubscribed. None of that surfaces from a single serial test.

Simulating a real waitlist with disposable inboxes

The fix is to stop testing one signup at a time and start testing a small population. Spin up a batch of throwaway inboxes, sign them all up in a tight window, and read back what each one actually received.

CyberTemp's API makes this cheap to script. GET /getMail?email=<address> both creates the inbox and reads it — there's no separate create step, so spinning up ten or fifty test addresses is just ten or fifty address strings, no provisioning call. A naming pattern like waitlist-test-{n}@cybertemp.xyz keeps each run's addresses easy to filter out of the queue afterward. The same polling shape works whether you're pulling a queue-position number or an OTP — see OTP test automation with CyberTemp's API if you already have that pattern built for signup tests and want to reuse it here.

  • Generate N addresses with a run-specific prefix so you can identify and clean up the batch later.

  • Fire the signups concurrently, not in a loop with a sleep between each — concurrency is the actual thing you're testing for.

  • Poll each inbox for its queue-position email and record the position, timestamp, and any ETA text.

  • Compare the set of positions against what the queue should have assigned given signup order.

Fifty inboxes is usually enough to catch race conditions that one inbox never will. You don't need thousands — you need concurrent writes landing close enough together to hit the same lock or the same batch job window your production traffic hits.

What actually breaks in a queue-position email

A few failure patterns show up often enough to check for explicitly:

Stale position numbers

If your queue count is calculated at signup time and cached into the email template, it goes stale the moment anyone ahead of that user drops off the list. Read the email a few minutes after signup, not immediately — that gap is where cached-vs-live position mismatches show up.

Off-by-one on the boundary

Whatever number triggers "you're off the waitlist, here's access" is a boundary condition, and boundary conditions are where queue logic breaks. Deliberately put test inboxes at position 1, position N (your batch-release threshold), and position N+1, and check that only the right ones get the access-granted email.

Referral bumps recalculating the wrong account

Most waitlists let existing members skip ahead by inviting others. That's a write to two records — the referrer's new position and the referred account's initial position — and it's exactly the kind of two-record update that goes wrong under concurrent referrals. Test one inbox referring three others in quick succession and verify all four positions land correctly, not just the referrer's.

ETA text that doesn't match the real backlog

"You'll get access in about 2 weeks" is usually computed from a rough send-rate assumption, not the live queue. When that assumption is wrong — say the batch-release job is paused — the ETA email keeps promising a date that won't happen. Worth asserting the ETA text is present and non-empty, at minimum; ideally cross-checking it against the actual configured release rate.

Wiring it into a test script

A minimal version of this in Python, using CyberTemp's flat endpoint structure:

import httpx, re, time, uuid

API_KEY = "tk_..."
HEADERS = {"X-API-Key": API_KEY}
BASE = "https://api.cybertemp.xyz"

def signup_address(n, run_id):
    return f"waitlist-{run_id}-{n}@cybertemp.xyz"

def wait_for_position_email(address, timeout=60):
    deadline = time.time() + timeout
    while time.time() < deadline:
        resp = httpx.get(f"{BASE}/getMail", params={"email": address}, headers=HEADERS)
        resp.raise_for_status()
        messages = resp.json()
        for msg in messages:
            match = re.search(r"position\s+#?(\d+)", msg.get("body", ""), re.I)
            if match:
                return int(match.group(1))
        time.sleep(2)
    return None

run_id = uuid.uuid4().hex[:8]
addresses = [signup_address(n, run_id) for n in range(50)]

# trigger your app's signup flow for each address here, concurrently

positions = {addr: wait_for_position_email(addr) for addr in addresses}
missing = [a for a, p in positions.items() if p is None]
print(f"{len(missing)} of {len(addresses)} never received a position email")

The important part isn't the polling loop, it's the assertions you run against positions afterward: no duplicates, no gaps larger than the batch of concurrent signups, no position assigned to an address before its signup request actually completed. This is the same batch-testing shape as testing transactional emails without a real inbox — a queue-position email is just a transactional email with state attached. Rate limits apply per API key the same way they do on any other endpoint here, so back off on 429s the same way described in handling rate limits and retries in CyberTemp API scripts.

Cleanup and CI wiring

Delete the test batch when the run finishes — DELETE /inbox?email=... per address, or just let expiry handle it if your plan's retention window is short enough. Either way, keep test-run addresses out of any dashboards or analytics your queue system reports on; a naming prefix makes them trivial to filter.

Run this as part of the same CI stage that already exercises your signup flow, not as a separate manual QA pass. Queue logic drifts quietly — a schema change to the position calculation, a new referral tier, a batch-release job that gets slower under load — and the only way to catch that drift before a user does is to keep re-running the concurrent test, not just the one you wrote the day the feature shipped.

Bottom line

A queue-position email is state, not a template. Testing it with one inbox and one signup tells you the template renders; it tells you nothing about whether the position it renders is correct under real concurrent traffic. Fifty disposable inboxes signing up in the same window, read back and checked for duplicates, gaps, and boundary errors, catches the bugs that actually reach production waitlists.

If you're building this kind of test suite, the paid tiers are where per-key request limits stop being the bottleneck for a fifty-or-more-inbox batch run, and where scripting a full concurrent test population stops meaning careful rate-limit budgeting. Check the plans if that's the stage you're at.

Share
    How to Test Waitlist and Queue-Position Emails | CyberTemp Blog