Changelog

Test your email integration with sandbox mode

Published on:

Testing an email integration usually means sending a few emails to yourself or to a throwaway address. That's fine once or twice. Do it every time you change something, and the bounces and repeat sends can start to hurt your domain's reputation.

Sandbox mode takes care of that. You keep sending your transactional emails through the API or SMTP exactly as before, and nothing ever lands in an inbox.

What is sandbox mode?

Sandbox mode is a per-project setting. Lettermint accepts and processes each email like it normally would, and stops right before handing it to the recipient's mail server. Validation still runs, so an invalid address gets the same error you'd see in production. Every email shows up in your dashboard.

Sandbox emails don't count toward your monthly usage. They're left out of your statistics, and a simulated hard bounce never ends up on your suppression list.

How it works

Turn on sandbox mode

Pick Sandbox as the delivery mode when you create a project. For an existing project, flip the toggle under Delivery mode in Settings. Your API tokens and SMTP credentials stay the same, so your code doesn't need to change.

Simulate a result

By default, every sandbox email is marked as delivered. To see how your app deals with a hard bounce or a spam complaint, set sandbox_result on the API request. Sending over SMTP? Use the X-Lettermint-Sandbox-Result header instead.

          curl -X POST "https://api.lettermint.co/v1/send" \
  -H "Content-Type: application/json" \
  -H "x-lettermint-token: lm_project_token" \
  -d '{
    "from": "sender@acme.com",
    "to": ["recipient@acme.com"],
    "subject": "Welcome to Acme",
    "text": "Thanks for signing up.",
    "sandbox_result": "hard_bounced"
  }'

        

Webhooks

Webhooks keep firing in sandbox mode, so you can test your handlers end to end. One thing to watch: new webhooks default to Live, which means they skip sandbox events. Set them to Sandbox or Both to receive them while testing.

Going live

When you're done testing, switch the project to Live and emails start going to real recipients. Make sure your domain is verified first. Live mode won't send from an unverified domain.

Available on Starter, Growth and Pro

Sandbox mode is included in the Starter, Growth and Pro plans. You can turn it on for any project in your dashboard (opens in a new window). The sandbox mode docs list every result you can simulate and explain how to tell sandbox events apart from live ones.