Email
Research
Email engineering guide

Choosing and designing a send-email API

Sending from a user's mailbox and sending product mail are separate architectures; choose the identity and delivery evidence first, then design composition, safety, retries, and result semantics.

Research surface only. This guide documents architecture and evaluation criteria; it does not describe a released DewEngine connector.
01
Sender model

Decide whose mailbox owns the message

Use Gmail, Microsoft Graph, or SMTP submission when the message must appear in a connected user's mailbox. Use a transactional delivery provider for application notifications from domains the product operates.

02
Request contract

Make composition explicit and validatable

Accept structured sender identity, recipients, subject, text and HTML alternatives, attachments, reply context, and an idempotency key. Validate addresses, size, authorization, and suppression before enqueueing.

  • Authorized sender or alias
  • To, Cc, Bcc, and Reply-To
  • MIME alternatives and attachments
  • Idempotency and correlation ID
03
Execution

Use a durable command instead of a fragile HTTP retry

Persist the send intent, perform the provider call once under a lease, record its acknowledgement, and publish the result. Retry only when the prior outcome is known or safely deduplicated.

04
Semantics

Name each state honestly

Queued, submitted, provider-accepted, delivered, bounced, opened, and replied are not interchangeable. Only expose later states when there is provider-supported evidence, and never infer an open from a successful send response.

  • Stable message state machine
  • Raw provider code
  • Bounce or delivery event where available
  • No unsupported engagement claims
Questions

Before you build.

Can an HTTP retry send the same email twice?+

Yes, if the first provider result is unknown. Require an idempotency key and retain the command and provider acknowledgement so a retry can return the original result.

Does a 200 response mean the recipient received the message?+

No. It means only what the API documents at submission time, typically that the provider accepted the request. Final delivery is a later and separate outcome.

Can I use DewEngine's email connectors today?+

Not yet. Gmail, Microsoft Graph, and IMAP/SMTP connectors are planned. This guide documents the intended architecture and the provider requirements a production release must satisfy.

Build with us

Does this match the workflow your users need?

DewEngine is in development. Real use cases decide what ships first.

Share your use case