Skip to content

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📧 CrewAI Weekly Email Scheduler

This project allows you to schedule automated weekly email updates generated by CrewAI using a simple Flask-based form UI. You specify the email time, day, and data file, and the agent handles everything — from crafting a report to sending it with attachments.


🚀 Features

  • ✅ Web form to schedule emails
  • 🤖 AI-generated email content using CrewAI
  • 📅 Automatically runs every week at scheduled time
  • 📎 Supports file attachments
  • 💬 Fun, dynamic email tone based on document content
  • 🔐 Uses Microsoft Graph API for email delivery

📦 Project Structure

.
├── crewai_config/
│   └── agents, tasks, and crew config files
├── static/
│   └── style.css (optional)
├── templates/
│   └── index.html (Flask form)
├── src/
│   └── emailcrew/
│       └── main.py  # Main scheduling and sending logic
│       └── crew.py  # Crew and Agent Defintions
│   └── config/
│       └── agents.yaml  #agents prompts
│       └── tasks.yaml   #task propmts


🛠️ Setup Instructions

1. Clone this repository

git clone https://github.com/mahadrehmann/CrewAI-Email-Agent-Flow.git

2. Create a virtual environment and activate it

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Set up environment variables

Create a .env file with the following:

GEMINI_API_KEY=your-gemini-key
AZURE_CLIENT_ID=your-client-id (If you opt to use Outlook, you can use gmail as well)

🧠 Memory-Level Scheduling Flow

Unlike file-based polling, this project uses in-memory events to wait for user input before proceeding.


🧪 How to Run

crewai run

This will:

  • Start the Flask server on http://127.0.0.1:5000
  • Wait until you submit the schedule form
  • Use CrewAI to generate an email
  • Schedule and send it every week at the time you set

🌐 Flask Form UI

Navigate to:

http://127.0.0.1:5000

Fill out this form:

  • 📄 File path (input file with context)
  • 📅 Day (e.g. monday)
  • ⏰ Time (24h format, e.g. 14:30)

📤 Example Email

Subject: Weekly Progress Update – Done with the Email Agent
To: mahadrehman04@gmail.com
Content: A breakdown of the work performed


📎 Attachment Format

The system attaches a summary text file (attachment.txt) along with the email. You can modify this in main.py.


🧠 Built With


About

A simple yet powerful Flask-based weekly email scheduler with Gemini-generated content and Outlook integration.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages