Skip to main content

Email

Send beautiful, reliable emails through Orbit’s email infrastructure powered by Resend. Build templates with React Email for pixel-perfect rendering across all clients, or send simple HTML and plain text.

Send an Email

curl -X POST https://api.orbit.devotel.io/api/v1/messages/email \
  -H "X-API-Key: dv_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "to": "user@example.com",
    "from": "notifications@yourdomain.com",
    "subject": "Your invoice is ready",
    "html": "<h1>Invoice #1234</h1><p>Your invoice for $49.00 is attached.</p>",
    "attachments": [
      {
        "filename": "invoice-1234.pdf",
        "content_type": "application/pdf",
        "content": "base64-encoded-content"
      }
    ]
  }'

Using Templates

Templates are a two-step flow: render your email-builder blocks into a complete HTML document, then send that HTML through the standard send endpoint. The direct /messages/email endpoint takes a finished html (or text) body — it does not accept a template_id or variables. Step 1 — render blocks to HTML with POST /api/v1/messages/email-builder/render. Merge values inline using {{...}} tags in your block content:
curl -X POST https://api.orbit.devotel.io/api/v1/messages/email-builder/render \
  -H "X-API-Key: dv_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "welcome_email",
    "blocks": [
      {
        "type": "header",
        "content": { "title": "Welcome, Alex!" }
      },
      {
        "type": "text",
        "content": { "text": "Thanks for joining Acme Corp. We are glad to have you." }
      }
    ]
  }'
The response contains the rendered HTML:
{ "data": { "html": "<!DOCTYPE html>...", "templateId": "etpl_..." } }
Step 2 — send the rendered HTML through POST /api/v1/messages/email:
curl -X POST https://api.orbit.devotel.io/api/v1/messages/email \
  -H "X-API-Key: dv_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "to": "user@example.com",
    "from": "hello@yourdomain.com",
    "subject": "Welcome to Acme Corp",
    "html": "<!DOCTYPE html>..."
  }'
Save reusable templates with POST /api/v1/messages/email-builder/save and list them with GET /api/v1/messages/email-builder/list.

Features

  • Transactional email — receipts, notifications, password resets
  • Marketing email — campaigns, newsletters, announcements
  • React Email templates — build and preview templates with React components
  • Attachments — PDF, images, and other file types (up to 25 MB total, 10 MB per file, with a MIME allowlist). Each attachment requires a content_type.
  • Custom domains — send from your own domain with DKIM, SPF, and DMARC
  • Tracking — open tracking, click tracking, and engagement webhooks
  • Suppression lists — automatic bounce and complaint handling

Domain Setup

To send from your own domain, add the following DNS records in Channels > Email > Domains:
RecordTypePurpose
DKIMTXTEmail authentication
SPFTXTSender authorization
DMARCTXTDelivery policy
Return-PathCNAMEBounce handling
Orbit verifies your DNS records automatically — verification typically completes within minutes.

Webhook Events

EventDescription
email.deliveredEmail accepted by recipient server
email.openedRecipient opened the email
email.clickedRecipient clicked a tracked link
email.bouncedEmail bounced (hard or soft)
email.complainedRecipient marked as spam