This Python script generates newsletters for the DCU Esports community. It uses a Jinja2 template to create customized newsletters with dynamic content.
Follow the instructions below to get started with the DCU Esports Newsletter Generator.
- Python 3.x
- Jinja2 (Python template engine)
- Flask (for the web GUI)
You can install the requirements using pip:
pip install -r requirements.txt
If you prefer the manual way of generating newsletters, follow these steps:
Note: Not all features are available in the manual generation method. Use the web GUI for the full experience.
- Clone the repository
git clone git@github.com:aydenjahola/email-generator.git
- Navigate to the project directory
cd email-generator
- Prepare your newsletter content by modifying the script. You can update the
topic_data
,tldr_data
, and other dynamic content as needed. - Create your newsletter template in HTML format. The template should include placeholders (using double curly braces) for dynamic content, which the script will replace.
- Save the newsletter template in the
templates
directory. - Update the script with the appropriate file paths and dynamic content.
- Run the script
python3 auto_generator.py
- The script will generate the newsletter, create an output directory based on the
week_number
, and save the newsletter in that directory. - You can find the generated newsletters in the
outputs
directory. Each newsletter is saved in a subdirectory named after the week number.
If you prefer a web GUI to generate newsletters, follow these steps:
- Clone the repository
git clone git@github.com:aydenjahola/email-generator.git
- Navigate to the project directory
cd email-generator
- you can create your template in the
templates
directory. The template should include placeholders (using double curly braces) for dynamic content, which the script will replace. - Run the script
flask run --debug
- Access the web GUI by opening a web browser and going to
http://localhost:5000
. - Fill out the form with the appropriate information and click
Generate Newsletter
. - The script will generate the newsletter, create an output directory based on the
week_number
, and save the newsletter in that directory. - You can find the generated newsletters in the
outputs
directory. Each newsletter is saved in a subdirectory named after the week number.
to deploy on docker you can use the script deploy.sh
to build and run the container
./deploy.sh
.
├── auto_generator.py
├── app.py
├── outputs
│ ├── week_1
│ │ └── week_1_newsletter.html
│ ├── week_2
│ │ └── week_2_newsletter.html
│ ├── week_3
│ │ └── week_3_newsletter.html
│ ├── week_4
│ │ └── week_4_newsletter.html
│ ├── week_5
│ │ └── week_5_newsletter.html
├── templates
│ └── newsletter_template.html
├── pages
│ ├── index.html
│ ├── success.html
│ ├── error.html
└── README.md
-
production server - add more dynamic content
- add more newsletter templates
- add more newsletter examples
- add more documentation
- optimize the app more
- add more error handling
- add tests
- add copy button
This project is licensed under the AGPLv3 License - see the LICENSE file for details.