TellWang
Dashboard

Email

Send transactional email from your Wok — confirmations, summaries, password resets. Deliverability (the SPF/DKIM/DMARC bits that keep mail out of spam) is handled for you.

Send (shipped)

Each Wok exposes a send endpoint backed by Resend. Sending from the operator's verified sender works out of the box; attach your own domain (see Bring your own domain below) to send from *@your-domain.com with the right DKIM/SPF/MX records.

send.ts
await tw.email.send({
  to: user.email,
  subject: "Welcome to Acme",
  text: "Thanks for signing up!",
});

Bring your own domain (or use mail.tellwang.com) (shipped)

Attach a sending domain to your org and TellWang registers it with Resend, returns the DKIM / SPF / MX records you need to publish, and — when the apex zone is already managed by TellWang's Cloudflare account — auto-publishes them so you skip the copy-paste entirely. The API surface is org-scoped:

register.sh
# 1. Register the domain
curl -X POST https://api.tellwang.com/v1/orgs/$SLUG/email/domain \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"mail.acme.com"}'
# → 201 { "domain": "mail.acme.com", "resend_id": "...", "status": "pending",
#         "dns_published": true,   // CF auto-publish succeeded
#         "dns_records": [ ... DKIM / SPF / MX ... ] }

# 2. Poll status (idempotent — re-call refreshes from Resend, never re-issues DKIM)
curl https://api.tellwang.com/v1/orgs/$SLUG/email/domains \
  -H "Authorization: Bearer $KEY"
# → 200 { "email_domains": [{ "domain": "mail.acme.com", "status": "verified", ... }] }

# 3. Send from your verified domain
curl -X POST https://api.tellwang.com/v1/email/send \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"hello@mail.acme.com","to":["user@example.com"],"subject":"hi","text":"hello"}'

# 4. Detach if you ever want to (idempotent 204)
curl -X DELETE https://api.tellwang.com/v1/orgs/$SLUG/email/domain/mail.acme.com \
  -H "Authorization: Bearer $KEY"

The registration call is fully idempotent — re-POSTing the same domain refreshes status from Resend without rotating the DKIM selector, so the records you already published keep working. The default TellWang-managed apex (mail.tellwang.com) is the same flow with no DNS work on your side.

Receive (shipped)

Mail addressed to a domain you've attached to your Wok (see Hosting & Domains) is delivered into your Wok's inbox. Replies, support requests, and inbound forms can either trigger logic via an Edge Function (DB-triggered functions) or be polled from your app:

inbox.ts
// list recent messages (subject/from/to only; bodies omitted)
const { messages } = await tw.email.inbox.list();
// fetch one with text + html bodies
const msg = await tw.email.inbox.get(messages[0].id);
await tw.email.inbox.delete(msg.id);

Routing follows your attached domain — anything addressed to *@your-domain.com lands in this Wok's inbox.

Roadmap