AI-powered email summarizer that automatically processes your selected emails and delivers concise summaries directly to your inbox. Perfect for staying on top of newsletters, updates, and important communications without getting overwhelmed.
- Automatically processes emails from specified senders
- Generates concise, actionable summaries using OpenAI's GPT models
- Sends summary digests to your preferred email address
- Customizable sender list and processing frequency
- Secure authentication using Google OAuth 2.0
- Python 3.8 or higher
- Gmail account
- OpenAI API account (paid)
- Google Cloud Platform account (free tier works)
# Clone the repository
git clone https://github.com/voralabs/email_summarizer.git
cd email_summarizer
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt-
Create a New Project
- Navigate to Google Cloud Console
- Click the top bar dropdown → "New Project"
- Name it "Email Summarizer" (or your preferred name)
- Click "Create"
-
Enable Gmail API
- Use the search bar at the top to find "Gmail API"
- Click "Enable API"
-
Set Up OAuth Credentials
- Go to "APIs & Services" → "Credentials"
- Click "Create Credentials" → "OAuth client ID"
- Configure the consent screen:
- User Type: External
- App name: "Email Summarizer"
- User support email: Your email
- Developer contact: Your email
- Add your Gmail address as a test user
- Create OAuth Client ID:
- Application type: Desktop app
- Name: "Newsletter Client"
- Download the credentials JSON file
- Rename it to
credentials.jsonand move it to the project root folder
- Visit the OpenAI Platform
- Create an account or log in
- Navigate to "API Keys" → "Create new secret key"
- Copy your API key for the next step
Create a .env file in the project root with the following:
OPENAI_API_KEY=your-openai-key
SUMMARY_EMAIL=your-email@example.com
Update the NEWSLETTER_SENDERS list in newsletter_processor.py:
NEWSLETTER_SENDERS = [
'newsletter1@example.com',
'newsletter2@example.com'
# Add more email addresses as needed
]python newsletter_processor.pyOn first run, your browser will open for Gmail authorization. Follow the prompts to grant access.
-
"Access Blocked" Error
- Verify OAuth consent screen configuration
- Ensure you're logged into the correct Google account
- Check if your email is added as a test user
-
"API Key Invalid" Error
- Verify
OPENAI_API_KEYin.envfile - Check key status in OpenAI platform
- Generate a new key if needed
- Verify
-
No Emails Being Processed
- Double-check newsletter sender addresses
- Verify emails are unread
- Check Gmail spam/filter settings
-
Authentication Issues
- Delete
token.json(if exists) and reauthorize - Ensure
credentials.jsonis in the correct location - Verify Google Cloud project is properly configured
- Delete
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and feature requests, please open an issue on GitHub.