> ## Documentation Index
> Fetch the complete documentation index at: https://docs.divorce.law/llms.txt
> Use this file to discover all available pages before exploring further.

# Email Intelligence

> AI-powered email management with automatic case filing, deadline extraction, conflict detection, and revenue recovery for divorce law practices

## Overview

Victoria's **Email Intelligence** transforms how divorce attorneys manage email correspondence. Unlike generic email integration, Victoria understands divorce law context, automatically files emails to cases, extracts deadlines, detects conflict levels, and helps capture billable time from every email interaction.

<Note>
  **Version 3.0** includes revenue recovery features: one-click time logging, billing analytics, and enterprise-grade email viewing.
</Note>

***

## Key Benefits

<CardGroup cols={2}>
  <Card title="25x Faster Processing" icon="bolt">
    Queue-based Victoria analysis processes 1,000 emails per sync
  </Card>

  <Card title="95%+ Auto-Filing" icon="folder-tree">
    Machine learning improves filing decisions over time
  </Card>

  <Card title="Deadline Extraction" icon="calendar-check">
    Automatically creates tasks from court dates and discovery deadlines
  </Card>

  <Card title="Revenue Recovery" icon="dollar-sign">
    One-click time logging captures billable time from emails
  </Card>
</CardGroup>

### ROI Impact

| Metric                 | Time Saved       | Value @ \$350/hr |
| ---------------------- | ---------------- | ---------------- |
| Email filing           | 4.2 hrs/week     | \$1,470/week     |
| Deadline extraction    | 0.3 hrs/week     | \$105/week       |
| Draft responses        | 2.5 hrs/week     | \$875/week       |
| Billable time recovery | 1.5 hrs/week     | \$525/week       |
| **Total**              | **8.5 hrs/week** | **\$2,975/week** |

**Annual Value: \$154,700 per attorney**

***

## Getting Started

### Step 1: Connect Your Email

1. Navigate to **Emails** in the main navigation
2. Click **Connect Gmail** or **Connect Outlook**
3. Authorize OAuth access in the popup
4. Grant required permissions

<Tabs>
  <Tab title="Gmail">
    **Permissions Required:**

    * Read emails and settings
    * Send emails on your behalf
    * Manage labels and drafts
  </Tab>

  <Tab title="Outlook">
    **Permissions Required:**

    * Read and send mail
    * Access mailbox settings
    * Offline access for sync
  </Tab>
</Tabs>

### Step 2: Configure Sync Settings

1. Go to **Settings → Email Intelligence**
2. Set initial sync window (default: 7 days)
3. Configure auto-filing threshold (default: 95% confidence)
4. Enable/disable desktop notifications

### Step 3: First Sync

1. Return to **Emails** page
2. Click **Sync Now** to start initial sync
3. Victoria analyzes emails in the background (2-5 minutes)
4. Check **Unfiled Inbox** for emails awaiting review

***

## Core Features

### Smart Email Inbox

The main inbox shows all synced emails with Victoria's analysis:

<AccordionGroup>
  <Accordion title="Stats Dashboard" icon="chart-line">
    * **Unfiled count**: Emails awaiting filing decision
    * **Analyzing**: Victoria currently processing
    * **Errors**: Failed syncs with auto-retry enabled
    * **Last sync**: Timestamp of most recent sync
  </Accordion>

  <Accordion title="Victoria's Analysis" icon="sparkles">
    For each email, Victoria provides:

    * **Conflict Score**: 0-100 temperature rating
    * **Urgency Level**: low, medium, high, urgent
    * **Emotional Tone**: professional, tense, inflammatory
    * **Filing Suggestion**: Recommended case with confidence %
    * **Deadline Detection**: Extracted dates highlighted
  </Accordion>
</AccordionGroup>

### Conflict Temperature Monitor

Victoria analyzes email tone and flags high-conflict communications:

| Score  | Tone         | Victoria's Action                        |
| ------ | ------------ | ---------------------------------------- |
| 0-40   | Professional | Normal processing                        |
| 41-70  | Tense        | Badge notification                       |
| 71-90  | Inflammatory | Alert + suggest 24hr delay               |
| 91-100 | Threatening  | Urgent alert + screenshot recommendation |

<Warning>
  **High Conflict Alert Example:**

  From: [opposing-counsel@firm.com](mailto:opposing-counsel@firm.com)
  Conflict Score: 75/100 (Inflammatory)

  Victoria recommends:

  * Do NOT respond immediately
  * Screenshot email for documentation
  * Consider 24-48 hour delay
  * Review with client before responding
</Warning>

### Deadline & Court Order Parser

Victoria automatically extracts and creates tasks for:

* **Court deadlines**: "Response due by November 25"
* **Discovery deadlines**: "Produce documents within 30 days"
* **Hearing dates**: "Hearing scheduled for December 15 at 9:00 AM"
* **Settlement deadlines**: "Offer expires November 30"

***

## Revenue Recovery (v3.0)

### Email Time Log Dialog

One-click billable time capture from any email. Log time without leaving the email viewer.

**Quick Time Presets:**

| Preset | Time    | Typical Use                         |
| ------ | ------- | ----------------------------------- |
| 6 min  | 0.1 hrs | Quick review of routine email       |
| 12 min | 0.2 hrs | Standard email read + response      |
| 18 min | 0.3 hrs | Detailed review with analysis       |
| 30 min | 0.5 hrs | Research required before responding |
| 1 hr   | 1.0 hrs | Complex legal matter discussion     |

**Features:**

* Auto-generated billing descriptions from Victoria's analysis
* Duplicate prevention (tracks which emails are already billed)
* Activity type selection (Email Review, Response, Client Comm, etc.)
* Real-time amount calculation

<Tip>
  **Pro Tip**: Victoria auto-generates professional billing descriptions like:

  *"Review and analyze email re: Discovery Response - Financial Affidavits. Opposing counsel requests extension for financial document production."*
</Tip>

### Billing Analytics Dashboard

Track your email-to-billing capture rate with comprehensive analytics:

<CardGroup cols={2}>
  <Card title="Time Capture Rate" icon="percent">
    Percentage of emails with time logged. Target: 90%+
  </Card>

  <Card title="Total Recovered" icon="dollar-sign">
    Dollar amount billed from email correspondence
  </Card>

  <Card title="Hours Logged" icon="clock">
    Total billable hours from emails this period
  </Card>

  <Card title="Potential Lost Revenue" icon="triangle-exclamation">
    Unbilled emails × estimated time × hourly rate
  </Card>
</CardGroup>

<Warning>
  **Revenue Recovery Warning:**

  45 emails without time logged

  Potential unbilled time: \~$3,150
      Based on industry average of 0.2 hrs per email at $350/hr
</Warning>

***

## Case Email View

Access all emails filed to a specific case from the Case Workspace → Emails tab.

**Features:**

* Email count badge
* Full-text search (subject, sender, body, Victoria summary)
* Conflict/urgency badges
* Victoria summary preview
* Compose new email in case context

### Enterprise Email Detail Modal

Click any email to open the premium viewer:

1. **Email Header**: Subject, From, To, CC, timestamp
2. **Victoria Analysis Panel**: Summary, conflict score, recommendations
3. **Email Body**: HTML rendering with scroll area
4. **Action Buttons**:
   * Reply (opens composer with thread context)
   * Log Time (one-click billing)
   * Create Task (from email content)
   * File to Case (move to different case)

***

## Machine Learning Auto-Filing

Victoria learns your filing patterns over time:

```
First email from jane.doe@oppcounsel.com:
→ Manual filing required (no pattern)

Second email from same sender:
→ 70% confidence suggestion

Fifth email from same sender:
→ 95% confidence auto-filing
```

The system stores patterns and continuously improves accuracy based on your corrections.

***

## Best Practices

<AccordionGroup>
  <Accordion title="Email Filing" icon="folder">
    1. Review Victoria's suggestions before manual filing (she learns from corrections)
    2. File emails from same sender to same case consistently
    3. Keep unfiled inbox under 50 emails for best accuracy
    4. Review weekly to keep Victoria sharp
  </Accordion>

  <Accordion title="Revenue Recovery" icon="dollar-sign">
    1. Log time immediately after reading important emails
    2. Use Victoria's auto-generated descriptions as starting points
    3. Check the billing analytics weekly for capture rate
    4. Review "unbilled emails" warning promptly
  </Accordion>

  <Accordion title="Conflict Management" icon="shield">
    1. Never respond immediately to high-conflict emails (70+)
    2. Screenshot inflammatory emails for documentation
    3. Consult with client before responding to threatening messages
    4. Use Victoria's recommended delay periods
  </Accordion>
</AccordionGroup>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Emails Not Syncing" icon="sync">
    **Possible causes:**

    1. Rate limit reached - wait 1 hour for quota reset
    2. Token expired - check Settings for "Connection Lost" badge
    3. Email outside sync window - adjust in Settings

    **Fix:** Reconnect OAuth or wait for rate limit reset
  </Accordion>

  <Accordion title="Victoria Analysis Stuck" icon="hourglass">
    **Cause:** Queue backlog or API timeout

    **Fix:**

    1. Check "Analyzing" count on dashboard
    2. If > 100 for 10+ minutes, contact support
    3. Click "Sync Now" to trigger manual retry
  </Accordion>

  <Accordion title="Time Already Logged Warning" icon="clock">
    **Cause:** Email was previously billed

    This is intentional duplicate prevention. The dialog shows:

    * Previous billing date
    * Hours logged
    * Original description
  </Accordion>
</AccordionGroup>

***

## Security & Compliance

<Note>
  All email data is protected by Row Level Security (RLS). Emails are only visible to authorized firm members with access to the relevant case.
</Note>

**OAuth Token Security:**

* Refresh tokens encrypted at rest
* Access tokens never stored (refreshed on-demand)
* Automatic revocation detection with user notification

**Email Storage:**

* Emails stored in firm's isolated database partition
* Subject to same data retention policies as case files
* Included in SOC 2 compliance scope
