MT
MailtestAPIInbound email docs

Testing Workflows

Common ways to use MailtestAPI in end-to-end and smoke-test pipelines.

Typical flow

  1. Trigger the product behavior that sends an email.
  2. Poll GET /v1/emails by recipient until the expected message appears.
  3. Fetch GET /v1/emails/{emailId} for full body content.
  4. Assert on subject, sender, links, HTML fragments, or raw headers.
  5. Mark or delete the message after the test completes.

Good polling strategy

  • filter by exact recipient where possible
  • keep limit low
  • stop polling as soon as the expected subject or sender matches
  • use the returned receivedAt to avoid stale-message assertions

Useful patterns

Signup confirmation

  • trigger account creation
  • poll by recipient
  • assert that the confirmation link exists in body.html or body.text

Password reset

  • trigger reset flow
  • fetch the latest matching email
  • parse the reset URL from the message body

Internal notifications

  • send a test event
  • verify labels, headers, or notes after downstream processing

Cleanup

If your tests create lots of captured mail, call DELETE /v1/emails/{emailId} when assertions are complete or periodically prune messages in teardown jobs.

On this page