Skip to content

📧This project is a Python-based email generator that creates and sends product promotion emails.

License

Notifications You must be signed in to change notification settings

ronknight/python-email-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edit in Eraser

This project is a Python-based email generator that creates and sends product promotion emails.

Overview • Structure • Scripts • Usage • Setup • Dependencies • Diagrams •


Overview

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.

Structure

  • .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 in product_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.

Scripts

email_template.mustache

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.

.env

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=

generate_images.py

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

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.

send_email.py

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.

Usage

Before running the scripts, ensure you have set up your environment variables in the .env file, including your email address and password.

Steps to Run

  1. Review and update the product data in product_data.json to ensure accuracy and relevance.
  2. Execute generate_images.py to generate the product banners.
  3. Run send_email.py to send the email campaign to the specified recipients.

Dependencies

  • Python 3.x
  • Required Python libraries (specified in requirements.txt )

Setup

  1. Clone this repository to your local machine.
  2. Install the required dependencies using pip install -r requirements.txt .
  3. Configure the .env file with your email credentials and other necessary settings.

Contributing

Contributions are welcome! If you have any ideas for improvements, bug fixes, or new features, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Diagrams

About

📧This project is a Python-based email generator that creates and sends product promotion emails.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published