Welcome to the AI Email Template Generator! 🎉 This tool uses OpenAI to help you generate and modify HTML & Handlebars email templates with ease. Whether you're building marketing emails or transactional notifications, this tool provides live previews and allows you to dynamically modify templates. 🤖
- 🔄 Live Preview: See your template updates in real-time.
- 📝 Code Editor: Modify the email template using a built-in code editor powered by CodeMirror.
- 💡 Handlebars Support: Dynamically insert Handlebars placeholders (e.g.,
{{productTitle}}
) into your template. - 🖼️ Dummy Data: Automatically pull placeholder data and images from DummyJSON.
- 🧩 AI Assistance: AI-powered responses help you quickly update and format your templates.
- 🎨 Export: Save your generated email template as an HTML file.
Before you can start using the AI Email Template Generator, you'll need to configure a few things:
First, clone this repository to your local machine:
git clone https://github.com/your-username/ai-email-template-generator.git
cd ai-email-template-generator
Create a .env
file in the root directory and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
Make sure you replace your_openai_api_key_here
with your actual OpenAI API key. You can get your API key by signing up at OpenAI.
Install all the required dependencies for both the frontend and backend:
npm install
You can now deploy the app locally:
npm start
By default, the app will be available at: http://localhost:3000
To deploy the app for production, follow these steps:
npm run build
This will bundle your frontend code and prepare it for deployment.
You can now deploy the generated build files to a server of your choice (e.g., AWS, Heroku, DigitalOcean, or your own VPS). Make sure your .env
file is correctly set up in the production environment.
To deploy to AWS, follow these steps:
- Set up an S3 bucket for static file hosting (for the frontend).
- Use AWS Lambda for the backend.
- Create a CloudFront distribution for CORS support.
Once deployed, your app will be fully functional on the cloud! ☁️
Once the app is running:
- You can chat with the AI and modify your email templates.
- The live preview will show the rendered HTML email in real-time.
- You can add Handlebars keys directly into the template (e.g.,
{{productTitle}}
,{{productPrice}}
). - Export the email template as an HTML file for immediate use.
We welcome contributions! To contribute:
- Fork this repository.
- Create a new branch:
git checkout -b my-feature-branch
- Make your changes.
- Push to your branch:
git push origin my-feature-branch
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
If you have any feedback, suggestions, or issues, feel free to open an issue or contact us!