hexclaveServerApp). If you don’t have that yet, follow Setup first, then enable Emails in the dashboard.
1. Connect an email server
Open Emails → Email Settings in the dashboard. Hexclave needs somewhere to send from. While developing, leave Shared selected. Built-in auth mail (verification, password reset, magic link) already works. CustomsendEmail calls also go out on shared — Hexclave wraps them as “dev emails” so recipients know they aren’t from your domain yet.
A development environment can only use Shared. Configure the other providers in the cloud dashboard.
Before production, switch to one of:
Saving a custom provider triggers a test email from the dashboard so you know the config works.
2. Pick transactional vs marketing
Every send is one of two categories:- Transactional — required for the product (verification, receipts, password reset). Users cannot opt out.
- Marketing — promotional or informational. Users can unsubscribe; Hexclave appends an unsubscribe link.
notificationCategoryName) or inside the template / draft with <NotificationCategory>. If you omit it everywhere, the category stays undefined and unsubscribe preferences are not applied — prefer setting it explicitly.
3. Brand with a theme
Themes wrap every email (header, footer, logo, background). Hexclave ships Default Light, Default Dark, and Default Colorful. Set a project default under Emails → Email Settings → Themes, or skip this step and use the default. To author your own theme as TSX:themeId: "your-theme-id", themeId: null for the project default, or themeId: false for no theme. Full theme API: Templates & themes.
4. Create a template
Built-in templates already cover verification, password reset, magic link, invitations, payment receipts, payment failures, and trial-ending notices — Hexclave sends those automatically when those flows run. Customize them under Emails → Templates. For your own product email, create a React Email template in the dashboard (or start from a clone). A minimal template looks like this:variablesSchemavalidates the variables you pass at send time.<Subject>and<NotificationCategory>live in the template so the content owns its subject and category.- Saving custom templates on Shared requires a custom email server; you can still edit and preview.
html in the next step, or compose a Draft in the dashboard instead.
5. Send your first email
From your server, callhexclaveServerApp.sendEmail(). Exactly one recipient selector and exactly one content source are required.
HTML (fastest smoke test):
Options reference
sendEmail resolves to void and throws on failure. Branch on stable errorCode values when present:
templateId or draftId values fail the request immediately (HTTP 400) — nothing is enqueued. Those errors typically have no errorCode in the switch above, so they fall through to default.
6. Schedule a send (optional)
PassscheduledAt to enqueue now and deliver later. Omit it to send as soon as the pipeline allows.
7. Watch delivery
AftersendEmail returns, the message shows up under Emails → Sent with a status such as Preparing, Rendering, Scheduled, Queued, Sending, Sent, Skipped, Render Error, or Server Error. Under the hood, Hexclave enqueues, renders, queues (respecting capacity and scheduledAt), sends (honoring unsubscribes), and tracks delivery.
From code:
8. Optional: compose without a code template
For one-off or campaign mail, open Emails → Drafts, create a blank draft or clone a template, edit with live preview, pick a theme and recipients, then send from the UI or withdraftId. Details: Drafts.
What you should have now
- An email server (Shared for development, custom for production)
- A theme (built-in or your own)
- A template, HTML body, or draft
- At least one successful
sendEmailfrom your backend - Visibility into delivery in Emails → Sent /
getEmailDeliveryStats
sendEmail for your own product mail.
Related
- Emails overview — capability FAQ
- Templates & themes — full template and theme APIs
- Drafts — dashboard composition and
draftId - Local vs cloud dashboard — where Shared vs custom providers apply