Most professionals spend 2-3 hours daily on email. OpenClaw can cut that to 30 minutes by automatically triaging, categorizing, and drafting responses.
This guide walks through the complete setup for Gmail. Outlook users can follow similar steps with the Microsoft Graph API.
How It Works
OpenClaw connects to your email via API and processes messages as they arrive:
- Reads incoming emails in real-time (or on a schedule)
- Categorizes by urgency using AI analysis of content, sender, and context
- Drafts responses for common scenarios based on your writing style
- Sends a daily digest summarizing what needs your attention
- Archives automatically newsletters, notifications, and spam
The key principle is draft mode: nothing sends without your approval. You stay in control while AI handles the tedious parts.
Prerequisites
Before starting, you'll need:
- A working OpenClaw deployment (Cloudflare or VPS)
- A Gmail account (personal or Workspace)
- 15 minutes for initial setup
Step 1: Enable the Gmail API
First, set up API access in Google Cloud Console:
- Go to console.cloud.google.com
- Create a new project (or select an existing one)
- Navigate to APIs & Services > Library
- Search for "Gmail API" and click Enable
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select "Web application" as the type
- Add your OpenClaw callback URL to authorized redirects:
- For Cloudflare: https://your-worker.workers.dev/auth/callback
- For VPS: https://your-domain.com/auth/callback
- Download the credentials JSON file
Step 2: Configure OpenClaw
Add your Gmail credentials to OpenClaw:
# For Cloudflare Workers
❯ npx wrangler secret put GMAIL_CLIENT_ID
❯ npx wrangler secret put GMAIL_CLIENT_SECRET
# For VPS
❯ echo "GMAIL_CLIENT_ID=your-client-id" >> .env
❯ echo "GMAIL_CLIENT_SECRET=your-client-secret" >> .env
Then install and configure the email skill:
❯ openclaw skill add email-triage
❯ openclaw configure email --provider gmail
Follow the prompts to authorize access. OpenClaw will open a browser window for Google OAuth.
Step 3: Set Up Categories
By default, emails are sorted into four categories:
| Category | Criteria | Action |
|----------|----------|--------|
| Urgent | Direct requests, deadlines mentioned, VIP senders | Notify immediately |
| Important | Requires response, business-related | Include in digest |
| Newsletter | Marketing, subscriptions, updates | Archive after 7 days |
| Spam/Noise | Automated notifications, obvious spam | Auto-archive |
Customizing categories
Edit config/email-rules.yaml to add your own rules:
categories:
- name: "Client Urgent"
conditions:
- sender_domain: ["bigclient.com", "importantcustomer.io"]
- subject_contains: ["urgent", "asap", "critical"]
action: notify_immediate
- name: "Team Updates"
conditions:
- sender_domain: ["your-company.com"]
- subject_contains: ["standup", "weekly", "update"]
action: batch_digest
- name: "Receipts"
conditions:
- subject_contains: ["receipt", "invoice", "order confirmation"]
action: archive_label
label: "Receipts"
VIP senders
Add senders who should always get priority:
vip_senders:
- "boss@company.com"
- "ceo@company.com"
- "*@bigclient.com" # Wildcard matching
Step 4: Configure Draft Responses
OpenClaw can draft responses based on email content. Enable this feature:
❯ openclaw configure email --enable-drafts
How drafts work
- OpenClaw analyzes the incoming email
- If it matches a pattern (meeting request, simple question, etc.), it drafts a response
- The draft appears in your Gmail Drafts folder
- You review, edit if needed, and send
Training on your style
For better drafts, let OpenClaw learn from your sent emails:
❯ openclaw email train --from-sent --limit 100
This analyzes your last 100 sent emails to learn your tone, common phrases, and response patterns.
Draft templates
Create templates for common responses in config/email-templates.yaml:
templates:
meeting_request:
trigger: "meeting|call|schedule|availability"
response: |
Thanks for reaching out. I'd be happy to meet.
Here's my availability this week:
[CALENDAR_AVAILABILITY]
Let me know what works for you.
quick_question:
trigger: "quick question|wondering if|do you know"
response: |
[AI_GENERATED_RESPONSE]
Let me know if you need anything else.
Step 5: Set Up the Daily Digest
Configure when and how you receive your email summary:
❯ openclaw configure email --digest-time "08:00" --digest-timezone "America/Chicago"
The digest includes:
- Urgent items: Emails needing immediate attention
- To respond: Messages awaiting your reply
- Drafts ready: AI-drafted responses for review
- Stats: Email volume, categories, time saved
Digest delivery options
- Email: Sent to your inbox (default)
- Slack: Posted to a channel
- Telegram: Sent as a message
- Webhook: POST to any URL
❯ openclaw configure email --digest-channel slack --slack-channel "#email-digest"
Troubleshooting
"Authentication failed" error
Your OAuth token may have expired. Re-authenticate:
❯ openclaw configure email --reauth
Emails not being processed
Check that the Gmail API is enabled and your credentials are correct:
❯ openclaw email test-connection
Drafts not appearing
Make sure draft mode is enabled and you have write access:
❯ openclaw configure email --enable-drafts --scope full
Rate limits
Gmail API has limits (250 quota units per user per second). If you're hitting limits:
- Reduce polling frequency
- Use push notifications instead of polling
- Batch operations where possible
Privacy and Security
- Credentials are stored locally (or in your Cloudflare/VPS secrets)
- Email content is processed in memory and not persisted
- API calls to Claude/GPT use your API key with data retention disabled
- OAuth tokens can be revoked anytime at myaccount.google.com
Results
Users typically report after 2-4 weeks:
| Metric | Before | After |
|--------|--------|-------|
| Daily email time | 2-3 hours | 30-45 minutes |
| Missed urgent emails | 2-3/week | 0 |
| Response time (urgent) | 4-6 hours | < 1 hour |
| Response consistency | Variable | Standardized |
The biggest win isn't time saved, it's mental overhead. Email anxiety drops significantly when you trust the system to surface what matters.
Next Steps
Once email triage is working:
- Add calendar integration to auto-schedule meetings from email requests
- Set up Slack/Discord forwarding for team collaboration
- Create custom workflows for specific email types (support tickets, sales inquiries)
Check out the skills directory for more automation ideas.