sendEmail response means the BosonMail API accepted your message, not that it reached the recipient. This guide shows you how to interpret statuses, persist message IDs, poll with backoff, and build a background reconciliation job so you always know the final outcome.
Accepted vs delivered
WhensendEmail returns success: true, the email is typically "queued". It then moves through states such as "sent", "delivered", or terminal states like "failed", "bounced", and "rejected". The exact transition order and meaning of each value is defined by the BosonMail backend and is not fully documented by BosonWare.
Terminal statuses you can stop polling on are:
delivered, failed, bounced, rejected. Do not treat deferred or sent as terminal.
Persist message IDs
Store themessageId from every successful send so you can check status later. A minimal database schema might look like this:
schema.sql
persist.ts
Poll with backoff
The SDK does not poll automatically. UsegetEmailStatus in a loop with a delay between attempts. Stop when you reach a terminal status or the maximum number of attempts.
poll-status.ts
Background reconciliation job
For production workloads, run a scheduled job that checks all pending messages instead of polling inline after every send.reconcile-job.ts
setInterval in a long-running worker process.
Error codes to watch for
Do not poll from browsers
getEmailStatus requires your BosonMail API key. Never call it from browser code. Run polling and reconciliation jobs on your server or in a secure background worker.
Delivery lifecycle diagram
Next steps
Production best practices
Secure keys, handle timeouts, and manage retries in production environments.
SDK reference: Email status
Read the concise SDK reference for getEmailStatus and status fields.
Error handling
Understand all SDK error shapes and how to respond to each.
First email
Return to the basics: send your first email and check its status.