Skip to content

An automated email processor that replies to unread emails, analyses content for priority, type, and team, generates personalized responses using Gemini API, and saves analysis in a CSV file.

Notifications You must be signed in to change notification settings

kartikmehta8/automated-email-reply-gemini

Repository files navigation

Email Automation and Analysis Script

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.

Features

  • 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.

Prerequisites

  • 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.

Usage

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.

File Structure

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.

About

An automated email processor that replies to unread emails, analyses content for priority, type, and team, generates personalized responses using Gemini API, and saves analysis in a CSV file.

Topics

Resources

Stars

Watchers

Forks