This project is an AI-powered email HTML generator that allows users to create professional, customized email templates using OpenAI's GPT model. It features theme extraction from websites, logo handling, and pre-defined email template selection.
- Generate HTML email content using OpenAI's GPT model
- Extract logo & color themes from website
- Fetch or upload logos for email templates
- Select from pre-defined email templates or create custom ones
- Preview email templates before generation
- Real-time chat interface for customizing email content
- Copy generated HTML with a single click
Main interface of the Email HTML Generator
-
Clone the repository:
git clone https://github.com/palashk290195/html-email-generator.git cd html-email-generator -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` -
Install the required packages:
pip install -r requirements.txt -
Set up your environment variables: Create a
.envfile in the root directory and add the following:OPENAI_API_KEY=your_openai_api_key_here LOGO_DEV_TOKEN=your_logo_dev_token_here UNSPLASH_APPLICATION_ID=your_unsplash_application_id_here UNSPLASH_ACCESS_KEY=your_unsplash_access_key_here UNSPLASH_SECRET_KEY=your_unsplash_secret_key_here -
Run the Flask application:
flask --app app run -
Open your browser and navigate to
http://localhost:5000
- Enter a website URL to extract its color theme and logo.
- Select an email template from the dropdown or choose "None" for a custom template.
- Preview the selected template using the "Preview Template" button.
- Enter your OpenAI API key, profile details, and specific instructions for the email content.
- Click "SEND" to generate the email HTML.
- Use the "Toggle Preview/Code" button to switch between the visual preview and HTML code.
- Copy the generated HTML using the "COPY HTML" button.
Contributions are welcome! Please feel free to submit a Pull Request.
- OpenAI for providing the GPT model
- Flask for the web framework
- Bootstrap for the frontend styling
