mailShiftAI

MailSift AI - Chrome Extension

An AI-powered Chrome extension that intelligently prioritizes and summarizes emails across Gmail, Outlook Web, and Yahoo Mail. Built with privacy-first principles and modern web technologies.

πŸš€ Features

Core Functionality

Privacy & Security

User Experience

πŸ“¦ Installation

For Development

  1. Clone the repository
    git clone https://github.com/yourusername/mailsift-ai.git
    cd mailsift-ai
    
  2. Open Chrome and navigate to Extensions
    • Go to chrome://extensions/
    • Enable β€œDeveloper mode” (toggle in top right)
  3. Load the extension
    • Click β€œLoad unpacked”
    • Select the project directory
  4. Configure OpenAI API Key (Optional)
    • Open summarizer.js
    • Replace 'sk-your-openai-api-key-here' with your actual OpenAI API key
    • Note: For production, implement a secure proxy endpoint (see Security section)

For Production

  1. Build the extension
    # Add build process if needed
    npm run build
    
  2. Package for Chrome Web Store
    • Zip all files (excluding development files)
    • Submit to Chrome Web Store

πŸ”§ Configuration

OpenAI API Key Setup

Option 1: Direct API Key (Development Only)

// In summarizer.js
this.apiKey = 'sk-your-actual-openai-api-key';

Option 2: Secure Proxy (Recommended for Production)

// In background.js - implement proxy endpoint
async function handleProxyRequest(data) {
  const response = await fetch('https://your-proxy.com/api/summarize', {
    method: 'POST',
    headers: { 'Authorization': 'Bearer your-proxy-key' },
    body: JSON.stringify(data)
  });
  return response.json();
}

Default Settings

The extension comes with sensible defaults:

πŸ—οΈ Architecture

File Structure

mailsift-ai/
β”œβ”€β”€ manifest.json              # Extension manifest (Manifest V3)
β”œβ”€β”€ content.js                 # Main content script orchestrator
β”œβ”€β”€ background.js              # Service worker for lifecycle management
β”œβ”€β”€ popup.html                 # Settings popup interface
β”œβ”€β”€ popup.js                   # Popup logic and event handling
β”œβ”€β”€ popup.css                  # Popup styling
β”œβ”€β”€ summarizer.js              # OpenAI API integration
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ email-detector.js      # Email service detection
β”‚   β”œβ”€β”€ email-extractor.js     # DOM email extraction
β”‚   β”œβ”€β”€ email-prioritizer.js   # Priority calculation and highlighting
β”‚   └── widget-manager.js      # Floating widget management
β”œβ”€β”€ styles/
β”‚   └── content.css            # Content script styling
└── README.md                  # This file

Key Components

Email Detector (utils/email-detector.js)

Email Extractor (utils/email-extractor.js)

Email Prioritizer (utils/email-prioritizer.js)

Widget Manager (utils/widget-manager.js)

Summarizer (summarizer.js)

πŸ”’ Security & Privacy

Privacy Commitments

Security Best Practices

Implementing Secure Proxy

For production use, implement a secure proxy endpoint:

// Example Node.js proxy endpoint
app.post('/api/summarize', async (req, res) => {
  const { content, options } = req.body;
  
  // Validate and sanitize input
  const cleanContent = sanitizeContent(content);
  
  // Make OpenAI API call with server-side key
  const response = await openai.chat.completions.create({
    model: 'gpt-4',
    messages: [
      { role: 'system', content: 'Summarize email content concisely' },
      { role: 'user', content: cleanContent }
    ]
  });
  
  res.json({ summary: response.choices[0].message.content });
});

🎯 Usage

Getting Started

  1. Install the extension
  2. Navigate to Gmail, Outlook, or Yahoo Mail
  3. Accept the privacy consent dialog
  4. Add priority keywords in the extension popup
  5. Watch as important emails are highlighted and moved to the top

Managing Keywords

Using the Widget

AI Summarization

πŸ› οΈ Development

Prerequisites

Development Workflow

  1. Make changes to source files
  2. Reload the extension in chrome://extensions/
  3. Refresh the email page to see changes
  4. Use Chrome DevTools for debugging

Testing

Building for Production

  1. Update version in manifest.json
  2. Implement secure proxy endpoint
  3. Remove development comments and console logs
  4. Package and submit to Chrome Web Store

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support

πŸ”„ Changelog

Version 1.0.0


Note: This extension is designed as a productivity tool with privacy in mind. Always review the privacy policy and ensure you’re comfortable with how your data is processed before using AI features.