MCPcopy Index your code
hub / github.com/312323205202/gmail-ai-whatsapp-v2

github.com/312323205202/gmail-ai-whatsapp-v2 @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
5 symbols 23 edges 1 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
# 📧 Gmail → AI → WhatsApp Automation Bot

A Python-based automation project that **reads Gmail emails, analyzes them using AI, and forwards important ones to WhatsApp via Twilio** — running continuously in the cloud.

---

## 🚀 What This Project Does

This bot:

1. **Monitors your Gmail inbox automatically**
2. Reads the latest email
3. Uses **OpenAI (GPT-4o-mini)** to decide whether the email is important  
4. If important → Sends a WhatsApp message via **Twilio**
5. Avoids sending the same email twice

---

## 🛠️ Tech Stack Used

- **Python**
- **Google Gmail API**
- **OpenAI API**
- **Twilio WhatsApp API**
- **Google Cloud (for deployment)**
- **dotenv (.env) for secure credentials**

---

## 📂 Project Structure

gmail_ai_whatsapp/ │── gmail_ai_whatsapp.py # Main program │── .env # API keys (NOT pushed to GitHub) │── .gitignore # Prevents secret files from uploading │── processed_ids.txt # Stores processed email IDs │── README.md # This file


---

## 🔐 Environment Variables (.env)

Create a `.env` file and add:

OPENAI_API_KEY=your_openai_key TWILIO_SID=your_twilio_sid TWILIO_TOKEN=your_twilio_token


⚠️ **DO NOT push this file to GitHub.** It is already ignored via `.gitignore`.

---

## ▶️ How to Run Locally

1. Install dependencies:
```bash
pip install google-api-python-client google-auth google-auth-oauthlib twilio openai python-dotenv
  1. Run the program:
python gmail_ai_whatsapp.py
  1. First time → You will be asked to log in to Gmail.

☁️ Cloud Deployment (Optional)

You can run this 24×7 on Google Cloud (free-tier e2-micro VM).

Steps:

  • Create a VM
  • Install Python & dependencies
  • Upload script + credentials
  • Run using screen or a background process

🎯 Use Case

Useful for:

  • Students & professionals who don’t want to miss important emails
  • Automated client notification systems
  • Smart email filtering using AI

📌 Future Improvements

  • Add email summarization before sending to WhatsApp
  • Filter by sender or subject
  • Add Slack or Telegram support
  • Store logs in a database

👨‍💻 Author

Sarvesh Karthik

Core symbols most depended-on inside this repo

Shape

Function 5

Languages

Python100%

Modules by API surface

gmail_ai_to_whatsapp.py5 symbols

For agents

$ claude mcp add gmail-ai-whatsapp-v2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page