Building end-to-end email delivery tests requires verifying emails actually arrive, not just that APIs succeed. This implementation uses Cloudflare Email Routing to catch test emails, a Cloudflare Worker to parse and store them in KV storage, and Rails tests that poll an HTTP API until delivery is confirmed. Each test sends to a unique address like test-{id}@domain.com to avoid collisions in concurrent CI runs. The approach runs in GitHub Actions nightly, uses Rails encrypted credentials for provider configuration, and has caught real production bugs like API parameter typos, region mismatches, and encoding issues across providers like AWS SES, Postmark, and SendGrid.
Table of contents
The ProblemThe ArchitecturePart 1: The Email Receiver (Cloudflare Worker)Part 2: The Rails Test HarnessPart 3: Rails Credentials for Provider ConfigPart 4: GitHub Actions IntegrationWhat This CatchesThe CostsTry It YourselfSort: