Sales Micro Tool
AI Cold Email Writer
This project generates cold email drafts, shorter variants, follow-ups, and CTA ideas from a simple outreach brief without using a database.
What It Does
- Takes an outreach brief, goal, tone, and email length.
- Returns a subject line, main email, short version, and follow-up email.
- Adds CTA ideas so outreach options are easier to test.
- Shows the final output inside a modal popup for fast copying.
Setup
- Open
functions/config.local.php. - Add your OpenAI API key to
openai_api_key. - Keep or change the default model in
openai_model. - Optional: add
adsense_clientandadsense_sidebar_slotto activate the right sidebar ad area. - Make sure PHP
curlis available on the server. - Load
/AiColdEmailWriter/in your browser through MAMP.
How To Use
- Paste the outreach brief.
- Select the goal, tone, and preferred email length.
- Add optional offer or context details.
- Click
Generate Email Pack. - Review and copy the output from the popup modal.
Folder Structure
index.php– main UI entry pointcss/style.css– interface stylingjs/app.js– browser-side interactions and modal flowfunctions/lib.php– prompt logic, OpenAI requests, validation, rate limitingfunctions/api.php– backend API endpointfunctions/config.local.php– local API key, model, and ad settingsstorage/logs– error and debug logs
Security Notes
- The
functionsandstoragefolders are protected with.htaccess. - Requests use a CSRF token.
- A simple file-based rate limit reduces abuse without a database.
Troubleshooting
- If generation fails, check
functions/config.local.phpfor the API key. - If the API returns an error, inspect the generated log file under
storage/logs. - If the popup does not open, make sure JavaScript is enabled.
- If folder protection does not work, make sure Apache allows
.htaccessoverrides.