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

# Email Integration

> Your agent reads vendor emails to extract spend, renewals, and contract data — automatically.

# Email Integration

Your inbox knows more about your SaaS stack than you think. Connect it and your agent starts extracting vendor data immediately.

## Why Connect Email?

<CardGroup cols={2}>
  <Card title="Automatic Discovery" icon="magnifying-glass">
    Find vendors from invoices, receipts, and renewal notices
  </Card>

  <Card title="Pricing Extraction" icon="dollar-sign">
    Automatically extract pricing and contract terms
  </Card>

  <Card title="Renewal Tracking" icon="calendar">
    Get alerts for upcoming renewals and contract changes
  </Card>

  <Card title="AI Classification" icon="robot">
    Smart categorization of vendor communications
  </Card>
</CardGroup>

## Connection Methods

### OAuth Connection (Recommended)

Connect Gmail or Outlook directly via OAuth for automatic email processing.

**Pros:**

* ✅ Fastest setup (2 minutes)
* ✅ Automatic historical scan (6 months)
* ✅ Real-time processing of new emails
* ✅ No manual configuration needed

**Cons:**

* ❌ Requires granting read access to email
* ❌ Processes all vendor emails (not selective)

<Card title="Connect Gmail" icon="google" href="/integrations/email/gmail">
  Step-by-step Gmail setup guide
</Card>

<Card title="Connect Outlook" icon="microsoft" href="/integrations/email/outlook">
  Step-by-step Outlook setup guide
</Card>

### Email Forwarding

Forward specific vendor emails to your unique Porcia address.

**Pros:**

* ✅ Full control over what Porcia sees
* ✅ No OAuth permissions needed
* ✅ Works with any email provider

**Cons:**

* ❌ Manual filter setup required
* ❌ No historical email processing
* ❌ Only processes forwarded emails

<Card title="Set Up Forwarding" icon="arrow-right" href="/integrations/email/forwarding">
  Email forwarding setup guide
</Card>

## What We Process

### Emails We Analyze

* ✅ Invoices and receipts
* ✅ Renewal notices
* ✅ Contract updates
* ✅ Pricing changes
* ✅ Product announcements from vendors
* ✅ License confirmations

### Emails We Ignore

* ❌ Personal emails
* ❌ Internal company emails
* ❌ Non-vendor communications
* ❌ Spam and promotional content (unless from known vendors)

<Info>
  We only process emails from known SaaS vendor domains. Personal emails are never read, stored, or processed.
</Info>

## How Email Processing Works

```mermaid theme={null}
graph LR
    A[Email Received] --> B[AI Classifier]
    B --> C{Vendor Email?}
    C -->|Yes| D[Extract Data]
    C -->|No| E[Ignore]
    D --> F[Match Vendor]
    F --> G[Update Dashboard]
    E --> H[Delete]
```

<Steps>
  <Step title="Email arrives">
    New email received via OAuth sync or forwarding
  </Step>

  <Step title="AI classification">
    Our AI determines if it's a vendor email and categorizes it (invoice, renewal, update, marketing)
  </Step>

  <Step title="Data extraction">
    Extract vendor name, pricing, dates, license counts, and other structured data
  </Step>

  <Step title="Vendor matching">
    Match to our global vendor database using domain, name, and aliases
  </Step>

  <Step title="Dashboard update">
    Information appears in your Porcia dashboard
  </Step>

  <Step title="Email content processing">
    Raw email content is stored encrypted for processing and automatically deleted after 90 days. Only structured metadata (vendor name, pricing, dates) is retained permanently for your dashboard.
  </Step>
</Steps>

## Email Categories

Porcia automatically categorizes vendor emails into three types:

### Actionable

Emails requiring your attention or response:

* Renewal notices
* Invoices and payment requests
* Contract changes
* License expiration warnings

### Updates

Informational emails about the product:

* Feature announcements
* Product updates
* Maintenance notifications
* Security updates

### Marketing

Promotional content:

* Sales emails
* Webinar invitations
* Case studies
* Newsletters

<Tip>
  You can customize which email categories trigger notifications in Settings → Notifications.
</Tip>

## Privacy & Security

### What We Store

* ✅ Vendor name and domain
* ✅ Email subject and date
* ✅ Extracted pricing and contract data
* ✅ Email category (actionable, update, marketing)

### What We DON'T Store Long-term

* ❌ Full email content (stored encrypted for 90 days, then automatically deleted)
* ❌ Email attachments (processed but not stored long-term)
* ❌ Personal emails (never processed)
* ❌ Email credentials (stored securely with encryption at rest)

### Security Measures

* **Encryption** - All data encrypted at rest (AES-256) and in transit (TLS 1.3)
* **OAuth Tokens** - Stored securely with encryption at rest
* **Access Control** - Only authorized Porcia services can access email data
* **Audit Logs** - Complete audit trail of all email processing

<Card title="Contact Support" icon="shield" href="mailto:support@porcia.org">
  Questions about how we protect your data? Contact us
</Card>

## Disconnecting Email

You can disconnect your email integration anytime:

1. Go to **Settings → Integrations → Email**
2. Click **Disconnect** next to your connected email
3. Confirm disconnection

<Warning>
  Disconnecting email will stop new vendor discovery from email. Historical data will be preserved unless you choose to delete it.
</Warning>

## Next Steps

<CardGroup cols={2}>
  <Card title="Connect Gmail" icon="google" href="/integrations/email/gmail">
    Set up Gmail integration
  </Card>

  <Card title="Connect Outlook" icon="microsoft" href="/integrations/email/outlook">
    Set up Outlook integration
  </Card>

  <Card title="Email Forwarding" icon="arrow-right" href="/integrations/email/forwarding">
    Set up email forwarding
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/troubleshooting/email-sync">
    Fix email sync issues
  </Card>
</CardGroup>
