\n

ShazaMail

Add Email Verification to Cypress and CI Pipelines

Cypress suites often need to verify account creation, invitations, and email-based login. A disposable inbox keeps those tests separate from personal email accounts.

Product documentation last reviewed: 2026-11-18

Laptop and mobile device used during software development and test automation

Keep credentials outside the repository

Store the ShazaMail API key in your CI provider's encrypted secrets and inject it only into the test job that needs it. Never hard-code a token in Cypress commands, commit it to a fixture, or print it during debugging. Use a dedicated key with the smallest available scopes, and rotate it if it appears in a log or artifact.

Create and correlate a test inbox

Before submitting the application form, create a new test inbox through the REST API. Attach a CI job or test-case identifier so message retrieval can be tied to the correct run. For parallel Cypress workers, use separate inboxes. Avoid sharing a single inbox between workers because order-dependent message consumption is a common source of false failures.

Wait for the message and assert its contents

Poll for the expected message until a fixed deadline rather than relying on a hard-coded delay. Validate the recipient and message context before extracting an OTP or opening a verification URL. Keep secrets out of Cypress screenshots, video recordings, browser console output, and uploaded test reports. If a message never arrives, fail with a safe diagnostic that points to the inbox and run identifier.

Respect API quotas and clean up safely

Read API rate-limit information, use bounded backoff, and avoid retrying validation errors. Reuse the same idempotency key when retrying the same create operation after a timeout. Expire or release test inboxes when the suite is complete, while retaining only the minimum diagnostic metadata needed for a failed run. This gives teams a repeatable way to test real email delivery in CI without exposing personal mailboxes.