File size: 3,083 Bytes
9a02dac
 
 
 
 
 
 
 
 
 
5301ae9
 
 
 
 
 
 
 
 
c356b87
5301ae9
 
c356b87
 
5301ae9
 
 
c356b87
5301ae9
c356b87
03708bb
 
5301ae9
 
 
 
 
c356b87
5301ae9
 
 
 
 
 
c356b87
 
 
 
 
5301ae9
 
 
c356b87
5301ae9
 
 
c356b87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5301ae9
9a02dac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
title: EMAILOUT
emoji: πŸ”₯
colorFrom: pink
colorTo: gray
sdk: docker
pinned: false
license: mit
---

# EMAILOUT - AI-Powered Email Sequence Generator

A Hugging Face Space application for generating personalized email outreach sequences using GPT.

## Features

- πŸ“€ Upload CSV files from Apollo with contact information
- 🎯 Select and customize products for outreach campaigns
- ✏️ Edit email prompt templates for each product
- πŸ€– AI-powered sequence generation using GPT (up to 10 emails per contact)
- πŸ“Š Real-time streaming of generated sequences
- πŸ’Ύ Download sequences as CSV for use in Klenty and other email tools
- πŸš€ Smartlead integration for direct campaign creation and lead pushing
- πŸ“ˆ Run history tracking for all Smartlead pushes

## Setup

1. Set your API keys as secrets in Hugging Face Spaces:
   - Go to Settings β†’ Secrets
   - Add `OPENAI_API_KEY` with your OpenAI API key value
   - Add `SMARTLEAD_API_KEY` with your Smartlead Admin API key value (required for Smartlead integration)
   - Add `SMARTLEAD_CLIENT_API_KEY` with your Smartlead Client API key value (optional, may be required for certain operations)

2. The app will automatically:
   - Create SQLite database in `/data/emailout.db`
   - Store uploaded CSV files in `/data/uploads/`
   - Generate and store email sequences
   - Track Smartlead run history

## Usage

1. **Upload CSV**: Upload your Apollo CSV file with contacts
2. **Select Products**: Choose which products to focus on for outreach
3. **Configure Prompts**: Customize email templates for each product
4. **Generate**: Let AI create personalized sequences for each contact (up to 10 emails per contact)
5. **Export Options**:
   - **Download CSV**: Export sequences as CSV for Klenty, Outreach, etc.
   - **Push to Smartlead**: Directly create campaigns and push leads to Smartlead
6. **View History**: Check run history for all Smartlead pushes

## Tech Stack

- **Frontend**: React + Vite + Tailwind CSS + Framer Motion + React Router
- **Backend**: FastAPI + Python
- **AI**: OpenAI GPT API
- **Database**: SQLite (Hugging Face Spaces persistent storage)
- **Integration**: Smartlead API for campaign management

## API Endpoints

- `POST /api/upload-csv` - Upload CSV file
- `POST /api/save-prompts` - Save prompt templates
- `GET /api/generate-sequences` - Generate sequences (SSE stream)
- `GET /api/download-sequences` - Download sequences as CSV (with all subject/body columns)
- `POST /api/push-to-smartlead` - Push sequences to Smartlead campaign
- `GET /api/smartlead-runs` - Get Smartlead run history

## Smartlead Integration

The app supports direct integration with Smartlead:
- Create new campaigns or use existing ones
- Automatically build sequence templates with variables ({{subject_1}}..{{subject_10}}, {{body_1}}..{{body_10}})
- Push leads with custom variables for personalized sequences
- Track all runs in the Run History page
- Dry run mode for testing without sending to Smartlead

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference