An API service that receives new signup information, researches business domains via web scraping, and generates personalized email drafts using AI, then posts these to a Slack channel.
This service automates the process of creating personalized outreach emails for new signups with business email addresses. It filters out free email providers, scrapes the company website to gather information, uses AI to generate a tailored email, and sends the draft to a Slack channel for review.
- Backend: Node.js with Express
- Deployment: Netlify's continuous deployment with Functions
- Web Scraping: Firecrawl API
- AI Generation: OpenAI API (GPT-4 Mini)
- Notification: Slack Webhook
- Authentication: Simple API key validation
- Filters out free email providers (Gmail, Yahoo, etc.)
- Scrapes company websites to gather business information
- Generates personalized email drafts using OpenAI
- Posts email drafts to Slack for review
- API key authentication to prevent abuse
- Error handling with Slack notifications for scraping failures
agent-smith/
├── .env # Environment variables
├── netlify.toml # Netlify configuration
├── package.json # Project dependencies
├── server.js # Express server
├── src/ # Source files
│ ├── domainChecker.js # Email domain validation
│ ├── emailGenerator.js # AI email generation
│ ├── emailProcessor.js # Main workflow orchestration
│ ├── slackNotifier.js # Slack integration
│ └── webScraper.js # Website scraping
├── netlify/ # Netlify serverless functions
│ └── functions/
│ └── server.js # Serverless function wrapper
└── public/ # Static files
└── index.html # Simple landing page
-
Clone the repository
-
Install dependencies:
npm install -
Configure environment variables in
.env:OPENAI_API_KEY: Your OpenAI API keyFIRECRAWL_API_KEY: Your Firecrawl API keySLACK_WEBHOOK_URL: Your Slack webhook URLAPI_KEY: Your chosen API key for authenticationPORT: Server port (default: 3000)
-
Start the server:
npm start
Endpoint: POST /api/process-signup
Headers:
Content-Type: application/json
X-API-Key: your-api-key-here
Request Body:
{
"email": "john@acmecorp.com",
"name": "John Smith"
}Response:
{
"message": "Signup received and being processed",
"email": "john@acmecorp.com",
"name": "John Smith"
}This project is configured for deployment on Netlify:
- Connect your repository to Netlify
- Configure environment variables in Netlify's dashboard
- Deploy using Netlify's continuous deployment
For local development:
npm install
npm start
The server will run on http://localhost:3000 by default.