Automatic Draft Generation
When you open an inbox thread for the first time, DelightBridge automatically generates a draft reply.How It Works
Thread Analysis
AI reads the entire email conversation, including:
- All previous messages (inbound and outbound)
- Customer’s name and email
- Message timestamps and direction
- Any context clues from the conversation
Context Integration
AI consults your configured resources:
- Reference Documents: FAQs, policies, help articles (Markdown format)
- Service Signature: Your HTML email signature
- Categories: Available category options for classification
Draft Creation
AI generates a complete response that:
- Uses the customer’s first name
- Matches the customer’s language (English, Korean, Japanese, etc.)
- Follows your documentation guidelines
- Maintains an empathetic, professional tone
- Automatically appends your configured signature
Draft generation is triggered automatically when you open a thread with status “inbox” that doesn’t already have a draft. See implementation in
MainLayout.tsx:389.Generation Indicator
While AI is generating your draft:Draft Editor
Once generated, the draft appears in a rich text editor with full formatting capabilities.Formatting Toolbar
- Text Formatting
- Structure
- Media
Basic text styling options:
- Bold (⌘B / Ctrl+B)
- Italic (⌘I / Ctrl+I)
- Underline (⌘U / Ctrl+U)
Strikethrough
Email Headers
The draft editor displays key email information at the top:| Field | Description |
|---|---|
| To | Customer’s email address (read-only) |
| From | Your service email address (read-only) |
| Re | Subject line (defaults to “Re: [original subject]“) |
Auto-Save
Changes to your draft are automatically saved:- Save Delay: 500ms after you stop typing
- Save Indicator: Shows “Saving…” then ”✓ Saved” when complete
- Persistence: Drafts are stored in the database and survive page refreshes
DraftEditor.tsx:62-71
Talk to Draft
Refine your draft using natural language instructions. The AI understands what you want and updates the draft accordingly.Using Talk to Draft
Enter Instructions
Type what you want changed in plain language:
- “Make it more concise”
- “Add step-by-step instructions”
- “Use a more formal tone”
- “Mention our 30-day refund policy”
Quick Prompts
Click any quick prompt button to instantly populate the instruction field:Make it more concise
Shortens the response while keeping key points
Make it more formal
Adjusts tone for professional or executive audiences
More empathetic tone
Adds warmth and understanding to the response
Add step-by-step instructions
Breaks down the solution into numbered steps
How It Works Behind the Scenes
When you submit an instruction:- AI receives:
- Your current draft content
- The instruction you entered
- The original email thread for context
- AI rewrites the draft to incorporate your changes
- The updated draft replaces the current one
- Your instruction is not visible to the customer
src/app/api/draft/talk/route.ts
You can use Talk to Draft multiple times to iteratively refine your response. Each instruction builds on the current draft state.
Translation Features
DelightBridge provides automatic translation to support multilingual customer communication.Incoming Message Translation
When a customer sends an email in a non-Korean language:- Auto-Detection: AI detects the message is not in Korean (using
isKorean()utility fromutils.ts:83) - Auto-Translate: The message is automatically translated to Korean in the background
- Toggle Display: Click “See translation” below the message to view the Korean version
- Side-by-Side: Original and translation are both accessible
ThreadView.tsx:50-59
Draft Translation Preview
Translate your draft reply to see how it reads in Korean:Generate Translation
If not already generated, click “번역 생성” (Generate Translation) or the refresh icon.
Language Detection
AI automatically detects the language of incoming emails and generates replies in that same language. Supported languages include:- English
- Korean (한국어)
- Japanese (日本語)
- Chinese (中文)
- Spanish (Español)
- French (Français)
- German (Deutsch)
detectedLanguage field is stored with each thread for reference (see types.ts:89).
Regenerate Draft
If you’re not satisfied with the generated draft, you can regenerate it from scratch.When to Regenerate
- The tone doesn’t match your brand
- AI missed key context from your reference documents
- You’ve updated your reference documents and want to apply changes
- The categorization is incorrect
How to Regenerate
- Click the “Regenerate” button with the refresh icon in the draft editor
- AI generates a completely new draft using the latest context
- Previous draft content is replaced (make sure you don’t have unsaved manual edits)
- AI may assign a different category based on re-analysis
Draft Attachments
Current Status: The attachment UI is present in the editor, but attachment sending via Gmail API is not yet implemented. Attachments added in the UI will not be sent with emails.
- Select files from your computer
- Preview attached files as chips below the editor
- Remove attachments before sending
Best Practices
Optimize Reference Documents
Optimize Reference Documents
Help AI generate better drafts:
- Keep reference docs up-to-date with current policies
- Use clear headings and bullet points in Markdown
- Include common scenarios and their ideal responses
- Add tone guidelines (e.g., “Always thank the customer first”)
Use Categories Effectively
Use Categories Effectively
Set up categories that reflect common request types:
- AI uses categories to understand context and tailor responses
- Well-named categories help with reporting and team workflows
- Keep the category list focused (5-10 categories is ideal)
Review Before Sending
Review Before Sending
AI-generated drafts are starting points, not finished emails:
- Always read the full draft before sending
- Check for factual accuracy (especially dates, numbers, links)
- Ensure tone matches your brand guidelines
- Use Talk to Draft for quick refinements
- Personalize with customer-specific details if needed
Iterative Refinement
Iterative Refinement
Get the perfect response with Talk to Draft:
- Start with the auto-generated draft
- Use Talk to Draft to adjust tone or add content
- Make final manual edits in the editor
- Save time compared to writing from scratch
Related Features
Email Management
Learn about multi-account inbox and thread organization
Service Management
Configure reference documents and signatures for AI to use