mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
Add drafts.mdx, and update references across emails docs.
This commit is contained in:
@@ -124,7 +124,8 @@
|
||||
"pages": [
|
||||
"guides/apps/emails/overview",
|
||||
"guides/apps/emails/guide",
|
||||
"guides/apps/emails/templates-and-themes"
|
||||
"guides/apps/emails/templates-and-themes",
|
||||
"guides/apps/emails/drafts"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: "Drafts"
|
||||
description: "Compose emails in the dashboard, then send from the UI or with draftId."
|
||||
sidebarTitle: "Drafts"
|
||||
---
|
||||
|
||||
Drafts are emails you compose in the Hexclave dashboard — not TSX files like [templates and themes](./templates-and-themes). Use them for one-off or campaign-style sends when you don't want to ship a template in code.
|
||||
|
||||
## Create a draft
|
||||
|
||||
Open **Emails → Drafts** in the dashboard:
|
||||
|
||||
1. Create a blank draft, or **clone a template into a draft** to start from existing content.
|
||||
2. Edit the body (including TSX source with live preview), pick a theme, choose recipients, and optionally schedule a send time.
|
||||
3. Save. Active drafts stay editable until you send them; sent drafts move to history and can be tracked in the outbox.
|
||||
|
||||
You can create and edit drafts while on the shared email server. Sending a draft (from the dashboard or from code) requires a custom email server — SMTP, Resend, or Managed — configured in the [cloud dashboard](https://app.hexclave.com).
|
||||
|
||||
## Send a draft
|
||||
|
||||
Send from the dashboard when you're ready, or trigger the same draft from your backend:
|
||||
|
||||
```typescript
|
||||
await hexclaveServerApp.sendEmail({
|
||||
userIds: ["user-id"],
|
||||
draftId: "your-draft-id",
|
||||
});
|
||||
```
|
||||
|
||||
`draftId` is one of the three content options on `sendEmail` (alongside `html` and `templateId`). Recipients, scheduling, and theme overrides work the same as any other send — see the [Emails guide](./guide).
|
||||
|
||||
## Related
|
||||
|
||||
- [Templates & themes](./templates-and-themes) - reusable TSX content and branding wrappers.
|
||||
- [Emails guide](./guide) - full `sendEmail` options, delivery, and server configuration.
|
||||
- [Emails overview](./overview) - high-level product overview.
|
||||
@@ -258,12 +258,4 @@ await hexclaveServerApp.activateEmailCapacityBoost();
|
||||
|
||||
## Drafts
|
||||
|
||||
The dashboard includes a full draft editor where you can compose emails visually before sending. Drafts support:
|
||||
|
||||
- TSX source editing with live preview
|
||||
- Theme selection
|
||||
- Recipient picker (specific users or all users)
|
||||
- Scheduling
|
||||
- Send history per draft
|
||||
|
||||
Once a draft is sent, it's marked as sent and its delivery can be tracked in the outbox.
|
||||
Compose emails visually in the dashboard under **Emails → Drafts**, then send from the UI or with `draftId`. See [Drafts](./drafts) for creating drafts, cloning from a template, and sending.
|
||||
|
||||
@@ -113,7 +113,7 @@ const info = await hexclaveServerApp.getEmailDeliveryStats();
|
||||
|
||||
## Can I compose without writing code?
|
||||
|
||||
Yes. The dashboard has a full draft editor with live preview, theme selection, a recipient picker, and scheduling. You can then either send the draft from the dashboard or programmatically using the `draftId`.
|
||||
Yes. The dashboard has a full draft editor with live preview, theme selection, a recipient picker, and scheduling. You can then either send the draft from the dashboard or programmatically using the `draftId`. See [Drafts](./drafts).
|
||||
|
||||
## Start here
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Templates & Themes"
|
||||
description: "Author email content with React Email templates and wrap it in reusable, branded themes."
|
||||
description: "Build email bodies with React Email templates, then wrap them in reusable branded themes."
|
||||
sidebarTitle: "Templates & Themes"
|
||||
---
|
||||
|
||||
@@ -106,4 +106,5 @@ Set a default theme for your project in the dashboard. You can also override the
|
||||
|
||||
## Related
|
||||
|
||||
- [Drafts](./drafts) - compose in the dashboard and send with `draftId` (not TSX templates).
|
||||
- [Emails guide](./guide) - sending emails, scheduling, the delivery pipeline, and server configuration.
|
||||
|
||||
Reference in New Issue
Block a user