An agent writes the reply, you stay in charge of it. Pick a tone and a length, see which facts from the record the draft used, edit the text, and send only after an approval. The draft and the send are callbacks you supply, and nothing leaves until you approve.
On this page
- Reply to a lead
- Renewal follow-up
- Support answer
- Meeting recap
- Intro email
Examples
On a phone
Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- to
{ name, email, avatar? }- Who the reply goes to. An invalid address is flagged and cannot be sent to.
- subject
string- The subject of the reply. The agent may suggest another; the person can edit it.
- thread
{ from, at, body }[]- Default
[] - The conversation so far, oldest first. The last message is shown above the draft and the whole thread goes to onDraft.
- facts
{ id, label, value, source? }[]- What the record knows that a reply might use. The draft cites some of them.
- onDraft
(req, signal) => Promise<{ subject?, body, factIds }>- Writes the reply. req has tone, length, maxWords, instruction, subject, facts and thread. factIds are the facts it used; unknown ids are dropped.
- onSend
({ to, subject, body }) => Promise<void>- Sends the email. Called only after the person approves. A rejection shows an error with Try again.
- agentName
string- Default
"Email agent" - The name on the approval card.
- defaultTone / defaultLength
"warm"|"direct"|"formal" / "short"|"medium"|"long"- Default
"warm" / "medium" - The starting choices.
| Prop | Type | Default | Description |
|---|---|---|---|
| to | { name, email, avatar? } | - | Who the reply goes to. An invalid address is flagged and cannot be sent to. |
| subject | string | - | The subject of the reply. The agent may suggest another; the person can edit it. |
| thread | { from, at, body }[] | [] | The conversation so far, oldest first. The last message is shown above the draft and the whole thread goes to onDraft. |
| facts | { id, label, value, source? }[] | - | What the record knows that a reply might use. The draft cites some of them. |
| onDraft | (req, signal) => Promise<{ subject?, body, factIds }> | - | Writes the reply. req has tone, length, maxWords, instruction, subject, facts and thread. factIds are the facts it used; unknown ids are dropped. |
| onSend | ({ to, subject, body }) => Promise<void> | - | Sends the email. Called only after the person approves. A rejection shows an error with Try again. |
| agentName | string | "Email agent" | The name on the approval card. |
| defaultTone / defaultLength | "warm" | "direct" | "formal" / "short" | "medium" | "long" | "warm" / "medium" | The starting choices. |
What it handles
- 01Asks a callback for a reply, with a tone (warm, direct or formal), a length (short, medium or long) and an optional instruction, and shows a loading line with Cancel while it waits.
- 02Lists the facts from the record that the draft used, and dims the ones it did not. An id the model invents is dropped.
- 03Gives you the text in a textarea to edit, with a word count against the length you asked for and an Edited mark.
- 04Redraft writes it again and keeps the old text one Undo away.
- 05Never sends by itself: Send for approval opens an approval card with the full email, and your onSend runs only after Approve.
- 06Drops a late answer, treats an unreadable one as an error with Try again, and aborts the call on Cancel, Redraft and unmount.
States
- First render
- Nothing. The empty state paints as it is
- none
- Drafting
- Skeleton lines fill the box the draft will have, so nothing jumps
- loop of the skeleton
- Draft arrives
- The text fades in over the skeleton and the facts it used appear
- 180ms, ease out
- Send for approval
- The approval card folds open under the button
- 180ms, ease out
- Deny or Approve
- The card folds shut
- 120ms, ease out
- Waiting
- The Agent Loader shows writing, then sending, then done
- loop, then 280ms once
- Reduced motion
- Everything changes at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The empty state paints as it is | none |
| Drafting | Skeleton lines fill the box the draft will have, so nothing jumps | loop of the skeleton |
| Draft arrives | The text fades in over the skeleton and the facts it used appear | 180ms, ease out |
| Send for approval | The approval card folds open under the button | 180ms, ease out |
| Deny or Approve | The card folds shut | 120ms, ease out |
| Waiting | The Agent Loader shows writing, then sending, then done | loop, then 280ms once |
| Reduced motion | Everything changes at once | 0ms |
Works with
When to use
When to use
- Answering an email from a lead or customer with a draft an agent wrote from the record, which a person edits and approves.
- Showing which facts a reply relied on, so the sender can check them before it goes.
When not to use
- Sending anything without a person reading it first: use Approval Prompt.
- A chat with a model: use Chat Composer.
- The history of emails on a record: use Record Timeline.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI AI Email Draft to my app and wire it to my own data.
- I need answering an email from a lead or customer with a draft an agent wrote from the record, which a person edits and approves. Set that up with the Knowns UI AI Email Draft.
- Which AI Email Draft props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "ai-email-draft" }) and search_docs({ query: "ai email draft" }). Pro props, full examples and source come back once your license key is in the MCP config.