This project automates email replies and performs analysis on incoming emails. It uses Gmail's IMAP protocol for retrieving emails, analyzes their content, generates a personalized response using the Gemini AI model, and saves the analysis in a CSV file.
- Automatic Email Replies: Sends personalized replies to unread emails.
- Email Analysis:
- Assigns priority to emails based on content.
- Categorizes emails into types (e.g., Technical, Marketing).
- Maps emails to teams (e.g., Engineering, Marketing).
- CSV Export: Saves email data, analysis results, and responses to
email_analysis.csv
.
- Node.js and npm installed.
- A Gmail account with:
- IMAP enabled.
- App password configured for email access.
- Gemini API keys for personalized email response generation.
Run the script:
node email-automation.js
- The script will fetch unread emails, analyze them, generate replies, send them, and save results in a CSV file.
email-automation/
├── gemini_client.js # Gemini client for personalized responses.
├── email-automation.js # Main script.
├── email_analysis.csv # Output file with analysis.
├── .env # Environment variables.
└── README.md # Project documentation.