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.
Email workspace
Lollipop includes a full Project Email workspace. Choose a Site, search its Inbox, filter by unread state, Site, recipient domain, or date, and read messages without model use. Opening a message records its durable read state, and Mark unread reverses it. You can download decoded attachments or the exact original .eml, draft a reply or new message, review it, and then explicitly send. An accepted reply returns to its source message and appends a durable sent copy with status and billing receipt; idempotent retries cannot duplicate it. Domains & setup and Delivery health hold the sending-domain and recovery controls; Forwarding and Automations are separate, Site-scoped workflows. Forwarding retains the Inbox copy and reports pending and failed deliveries. Open a delivery to see its recipient, attempt count, next retry, stable error code, and safe recovery guidance without exposing the message body or raw provider response. Automations begin as drafts, expose the exact message fields an approved Site function may read, require a side-effect-free test of the unchanged rule before Enable, and retain safe run receipts across Pause, Resume, failure, and Remove. Inbox delivery is independent and run history does not copy message bodies. Email delivery is measured in email units, separately from the monthly model allowance and prepaid balance.
Draft with Wang first asks what the reply should achieve. Estimate model usage validates the selected Site, message, and Project and returns a bounded estimate without calling a model. Confirm & draft then makes one metered request, trying the private model before DeepSeek or Kimi if the provider explicitly rejects the call. The monthly model allowance is used first; later usage draws from the prepaid balance. Wang can use only the selected message and approved Project/company knowledge. Email content is untrusted and never grants tools or permissions. The result is an editable draft; it cannot send itself.
Domain health treats Receiving and Sending as separate systems. Each has its own not started, DNS pending, verified, or error state. View DNS shows the exact inbound MX separately from sending-provider records and detected values; repeating verification is safe and uses neither the model allowance nor prepaid balance.
Delivery health links to Billing with the Email filter already active. In All Sites mode it keeps one row per managed Site, sorts unavailable and owner-action states first, and shows receiving, forwarding, sending, automation, pending/failed, last-success, and current-month unit evidence. A row opens that exact Site's recovery screen, and one failed health read does not hide the other Sites. Monthly totals are shown only to roles that can read Billing instead of turning denied data into a false zero. The ledger separates received, sent, and forwarded units by Site, quantity, charge state, and receipt. Received mail is marked not charged; email and forwarding stay in the email-unit ledger.
Send
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.
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)
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:
# 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 "Idempotency-Key: $REQUEST_ID" \
-H "Content-Type: application/json" \
-d '{"from":"hello@mail.acme.com","to":["user@example.com"],"subject":"invoice","text":"attached","attachments":[{"filename":"invoice.pdf","content":"JVBERi0xLjQK","content_type":"application/pdf"}]}'
# 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. Sending requires a build-capable organization key; read-only viewers and billing-only members cannot send or create usage charges.
TellWang records and reserves each outbound send before contacting the provider. Attachments use a filename plus Base64 content and optional content_type; contentType is also accepted for compatibility, and the complete encoded message is limited to 40 MB. Attachment bytes remain part of the durable delivery payload and idempotency identity. An Idempotency-Key is required: assign one key to the email's durable event or job, and reuse that key with the same body for every retry. A durable delivery queue resumes an interrupted Resend request with the same provider idempotency key, stopping before the provider's 24-hour key expiry, then clears the queued addresses and content after acceptance, rejection, or an outcome that can no longer be replayed safely. If safe replay is impossible, TellWang pauses the receipt for provider-confirmed support reconciliation instead of risking a duplicate send or charge. A response is successful only after the provider message id is durable; billing finalization then retries safely after a restart.
Receive
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:
// 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.
Automatically forward
Forward every new message to an external address without losing its attachments or provenance. TellWang captures the untouched RFC 822 message before it enters a durable, metered retry queue. The readable forward is sent from forwarder@your-domain.com with Reply-To set to the original sender; it includes the original attachments and an exact original_message.eml. Original SMTP sender and recipient values travel in X-TellWang-Original-Envelope-From and X-TellWang-Original-Envelope-To.
# Enable or change the destination
curl -X PUT https://api.tellwang.com/v1/woks/$WOK/email-forwarding \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"to":"owner@example.com"}'
# Delivery health, then disable when no longer needed
curl https://api.tellwang.com/v1/woks/$WOK/email-forwarding -H "Authorization: Bearer $KEY"
curl -X DELETE https://api.tellwang.com/v1/woks/$WOK/email-forwarding -H "Authorization: Bearer $KEY"The destination must use a different domain from the Wok, which prevents forwarding loops. Failed provider deliveries remain visible in the Wok diagnostic and retry with bounded backoff.
Automate inbound mail
Connect one approved deployed Edge Function to new inbound messages. Lollipop lists only functions deployed on the selected Site, lets the owner limit sender, recipient, subject, and readable message fields, and restores the durable draft after refresh. The exact draft must pass a safe test before Enable. That test evaluates matching and shows the proposed payload fields without invoking the function. Pause or Remove stops future runs without changing Inbox delivery or deleting prior receipts.
# Save a draft
curl https://api.tellwang.com/v1/woks/$WOK/email-handler -H "Authorization: Bearer $KEY"
curl -X POST https://api.tellwang.com/v1/woks/$WOK/email-handler \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"function":"handle-inbound-email","status":"draft","filters":{"subject_contains":"booking"},"read_fields":["id","from","subject","body_text"]}'
# Side-effect-free sample test, then enable the unchanged draft
curl -X POST https://api.tellwang.com/v1/woks/$WOK/email-handler/test \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{"sample":true}'
curl -X POST https://api.tellwang.com/v1/woks/$WOK/email-handler \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"function":"handle-inbound-email","status":"enabled","filters":{"subject_contains":"booking"},"read_fields":["id","from","subject","body_text"]}'
# Remove the rule; history remains
curl -X DELETE https://api.tellwang.com/v1/woks/$WOK/email-handler -H "Authorization: Bearer $KEY"