OpenClaw
Caso de usoPrincipiante10 min

How to Build a Smart Email Digest with OpenClaw

Set up an AI-powered email digest that prioritizes your inbox, summarizes important messages, and delivers a concise daily briefing. Stop drowning in unread emails.

Última actualización: 2026-03-31

Skills necesarios

Summarize
Recomendado

Resumir URLs, PDFs, videos y documentos.

Cron Creator
Recomendado

Crear expresiones cron desde lenguaje natural.

What You'll Build

A smart email digest workflow that:

  1. Scans your inbox for unread emails from the past 24 hours
  2. Prioritizes messages based on sender importance, urgency signals, and content
  3. Summarizes each email into a brief with the key ask or information
  4. Delivers a digest so you can process your inbox in 5 minutes instead of 30

By the end of this guide, you'll have a daily email briefing that tells you what matters without opening every single message.

Why Automate Email Triage

Email is the most universal communication tool, but it's also the most overwhelming:

  • Volume — the average professional sends and receives 120+ emails per day, and that number keeps growing
  • Priority blindness — important emails from your manager sit next to newsletters and automated notifications
  • Processing time — reading, triaging, and responding to email takes 2-3 hours per day for most knowledge workers
  • Missed deadlines — action items buried in long email threads get forgotten
  • Anxiety — an overflowing inbox creates constant low-level stress

An AI-powered digest reads everything, surfaces what's important, and gives you a clear picture of what needs your attention — before you even open your email client.

Prerequisites

  • OpenClaw installed and configured (Getting Started Guide)
  • Gmail account with API access enabled
  • Node.js 18+

Step 1: Install the Required Skills

bash
# 1. Gmail integration
npx clawhub@latest install gmail

# 2. AI summarization
npx clawhub@latest install summarize

# 3. Scheduled delivery
npx clawhub@latest install cron

Step 2: Configure Gmail Access

The Gmail skill connects to Gmail through the Maton API gateway, which handles OAuth authentication for you.

Set Up Maton

  1. Sign up at maton.ai — the free Hobby tier includes unlimited requests
  2. Go to maton.ai/settings and copy your API key
  3. Set the environment variable:
bash
export MATON_API_KEY="your_api_key_here"

Connect Your Gmail Account

bash
clawhub inspect gmail

The skill will guide you through connecting your Gmail account via Maton's OAuth flow — a browser window opens for Google login. Once connected, the skill can read and manage your emails through the Maton gateway.

Note: The Gmail skill has both read and write capabilities. For the digest workflow, only read operations are used. No emails will be sent or modified unless you explicitly configure write actions.

Step 3: Configure Priority Rules

Define how the digest prioritizes your emails:

yaml
# .openclaw/email-digest.yml
priorities:
  critical:
    - from_domain: "yourcompany.com"
      sender_title: ["CEO", "CTO", "VP", "Director"]
    - subject_contains: ["urgent", "ASAP", "deadline", "incident", "outage"]
    - has_calendar_invite: true

  high:
    - from_domain: "yourcompany.com"
    - from_contacts: "starred"
    - is_reply_to_my_email: true

  medium:
    - from_domain: ["github.com", "linear.app", "jira.atlassian.com"]
    - subject_contains: ["review requested", "assigned to you", "mentioned you"]

  low:
    - is_newsletter: true
    - is_automated: true
    - from_noreply: true

ignore:
  - is_promotional: true
  - from_domain: ["marketing-spam.com"]

Step 4: Test Your First Digest

Run the digest by asking OpenClaw to scan your inbox:

Scan my Gmail inbox for the last 24 hours and create a prioritized digest
with action items, important messages, and a summary of everything else.

Example output:

=== Email Digest ===
Date: March 31, 2026 | 47 unread emails

## Critical (2 emails)

1. **[Action Required] Q2 Budget Approval Needed by EOD**
   From: Sarah Chen (CFO) | 3 hours ago
   Summary: Q2 department budgets need your sign-off by end of day.
   Budget spreadsheet attached. Your department's total is $340K,
   up 12% from Q1. She flagged the new headcount line item for discussion.
   → Action: Review and approve budget spreadsheet

2. **Re: Production Incident — API Gateway Timeout**
   From: DevOps Team | 1 hour ago
   Summary: API gateway timeouts affecting 15% of requests since 6 AM.
   Root cause identified: connection pool exhaustion after last night's
   deployment. Hotfix PR is ready, needs approval to deploy.
   → Action: Approve hotfix PR #456

---

## High Priority (5 emails)

3. **Re: Architecture Review — New Auth Service**
   From: Mike Torres (Tech Lead) | 5 hours ago
   Summary: Mike responded to your questions about the auth migration.
   Recommends gRPC over REST for internal services. Attached a
   comparison doc. Asks if you can join Thursday's design review.
   → Action: Reply to confirm Thursday availability

4. **[GitHub] PR #92 Review Requested: Payment Service v3 Migration**
   From: github.com | 2 hours ago
   Summary: Carol opened a PR migrating payment processing to Stripe v3 API.
   892 lines changed across 12 files. Tests passing. She noted two
   breaking changes that need documentation updates.
   → Action: Review PR #92

[... 3 more high priority emails ...]

---

## Medium Priority (12 emails)

- 5 GitHub notifications (3 PR reviews, 2 issue mentions)
- 4 Jira updates (sprint items status changes)
- 3 Slack email digests

---

## Low Priority (28 emails)

- 15 newsletters (TechCrunch, TLDR, Morning Brew, etc.)
- 8 automated notifications (CI/CD, monitoring, backups)
- 5 marketing/promotional emails

---

## Quick Stats
- Emails requiring your action: 4
- Emails requiring your reply: 3
- Emails for information only: 40

Step 5: Schedule the Digest

bash
# Daily digest at 8:00 AM
clawhub run cron --schedule "0 8 * * *" --task "gmail --digest"

# Twice daily — morning overview and afternoon catch-up
clawhub run cron --schedule "0 8,14 * * *" --task "gmail --digest --hours 12"

Step 6: Customize the Output

Suggested Responses

Enable AI-generated response suggestions for emails requiring your reply:

yaml
digest:
  suggest_responses: true
  response_style: "concise and professional"

The digest will include draft responses like:

→ Suggested reply: "Thanks Sarah, I've reviewed the Q2 budget.
   Approved as-is. Let's discuss the headcount line item at
   our 1:1 on Wednesday."

Action Item Extraction

Pull all action items into a single list:

yaml
digest:
  action_items: true

Adds a section at the top:

## Your Action Items
1. Approve Q2 budget spreadsheet (from Sarah Chen, due EOD)
2. Approve hotfix PR #456 (from DevOps, urgent)
3. Review PR #92 (from Carol, payment migration)
4. Reply to Mike about Thursday design review

Delivery Options

  • Terminal — default, prints to stdout
  • Markdown fileoutput: "~/digests/{{date}}-email.md"
  • Telegram — combine with Telegram skill for mobile delivery
  • Separate email — send the digest to a different address or alias

Advanced: Smart Filtering

Thread Summarization

For long email threads, the digest collapses the entire conversation into a summary:

yaml
digest:
  thread_summary: true
  # Instead of showing each reply, summarize the full thread
  # "12-email thread about auth migration. Key outcome: team agreed
  #  on gRPC. Design review scheduled for Thursday."

VIP Senders

Mark certain senders whose emails always appear in the Critical section regardless of content:

yaml
vip_senders:
  - "ceo@yourcompany.com"
  - "your-manager@yourcompany.com"
  - "key-client@bigcorp.com"

Custom Categories

Add categories beyond the default priority levels:

yaml
categories:
  - name: "Hiring"
    conditions:
      - from_domain: "greenhouse.io"
      - subject_contains: ["candidate", "interview", "offer"]
  - name: "Finance"
    conditions:
      - from_domain: ["expensify.com", "stripe.com"]
      - subject_contains: ["invoice", "payment", "expense"]

Troubleshooting

"Authorization failed"

  • Verify your MATON_API_KEY is set correctly as an environment variable
  • Check your Gmail connection status in the Maton dashboard
  • Try reconnecting your Gmail account: clawhub inspect gmail

Digest shows no emails

  • Check the time window: default is 24 hours, adjust with --hours
  • Verify the Gmail account has unread emails in the inbox (not in folders)
  • Ensure the Maton connection is active: clawhub inspect gmail

Some emails are missing from the digest

  • Check your ignore rules — they might be filtering too aggressively
  • Emails in Spam or Trash are excluded by default
  • Labels-based filtering may skip emails in specific Gmail categories

Digest takes too long to generate

  • Reduce the number of emails processed: lower --hours or add more ignore rules
  • For inboxes with 200+ daily emails, consider running the digest twice daily with 12-hour windows
  • Network latency to Gmail API can vary — check your connection

Preguntas Frecuentes

The skill accesses email metadata (sender, subject, date) and body text for emails matching your priority rules. It reads only emails from the configured time window (default: last 24 hours). All processing happens locally on your machine — email content is sent to your AI provider for summarization but is not stored anywhere else.

This guide covers Gmail specifically. For Outlook, install the `outlook` skill instead of `gmail` — the digest workflow is identical. Other IMAP-compatible providers can be accessed through the `imap` skill with manual server configuration.

No. The skill opens emails in read-only mode. Your inbox state is completely unchanged after the digest runs. Unread emails remain unread, and no labels or stars are added or removed.

The digest workflow is read-only by design. The suggested responses feature generates drafts but does not send them. If you want to send responses, you would use the Gmail skill's write mode separately, after reviewing the suggestions.

The Gmail skill connects through the Maton API gateway, which manages OAuth tokens on your behalf. Your Maton API key is stored locally. You can revoke Gmail access at any time from your Google Account security settings or by removing the connection in your Maton dashboard.

Yes. Configure multiple Gmail accounts by running `clawhub inspect gmail` for each account. Name each configuration (e.g., `gmail-work`, `gmail-personal`) and reference them in your digest schedule. You can get separate digests or a combined one.

Casos de uso relacionados