Overview • Structure • Scripts • Usage • Setup • Dependencies • Diagrams •
The Python Email Generator automates the process of creating and sending product promotion emails. It's particularly useful for businesses or marketers who want to efficiently reach out to their customers with visually appealing email campaigns featuring product banners.
.env
: Configuration file containing environment variables, such as email credentials. This file is not tracked by Git..gitignore
: Specifies files and directories to be ignored by Git, such as sensitive data or virtual environment folders.email_template.mustache
: HTML template for the emails, using the Mustache templating language to insert product data.fonts/
: Directory containing font files used for the subject line in the emails.arial.ttf
impact.ttf
generate_images.py
: Script to generate the banner used in the emails, leveraging product data and images.generated_banner/
: Directory to store the generated email banners.image_templates/
: Directory containing templates for product images, if applicable.product_data.json
: JSON file serving as a dictionary for the product data, including names, prices, image URLs, and other details.products/
: Directory containing the actual product images referenced inproduct_data.json
.README.md
: Markdown file providing an overview of the project, usage instructions, and other details.send_email.py
: Script to generate and send the email campaign, incorporating the generated banner and other necessary information.
This file serves as the HTML template for the emails. It allows dynamic insertion of product data into the email content using the Mustache templating language.
The .env
file contains environment variables, including the email address and password used to send the emails. It's essential for securely storing sensitive information and should not be tracked by version control systems like Git.
EMAIL_ADDRESS=
EMAIL_PASSWORD=
EMAIL_SERVER=
This script generates the banner used in the emails. It processes the product data from product_data.json
and utilizes images from the products/
directory to create visually appealing banners.
product_data.json
acts as a dictionary for the product data used in generating the email banners. It contains information such as product names, prices, image URLs, and other relevant details.
This script is responsible for generating and sending the email campaign. It incorporates the banner generated by generate_images.py
and other necessary information such as the subject line, recipient list, and SMTP server details.
Before running the scripts, ensure you have set up your environment variables in the .env
file, including your email address and password.
- Review and update the product data in
product_data.json
to ensure accuracy and relevance. - Execute
generate_images.py
to generate the product banners. - Run
send_email.py
to send the email campaign to the specified recipients.
- Python 3.x
- Required Python libraries (specified in
requirements.txt
)
- Clone this repository to your local machine.
- Install the required dependencies using
pip install -r requirements.txt
. - Configure the
.env
file with your email credentials and other necessary settings.
Contributions are welcome! If you have any ideas for improvements, bug fixes, or new features, please open an issue or submit a pull request.
This project is licensed under the MIT License.