This project implements a message queue consumer application that processes notification delivery tasks via email.
- Python 3+: Ensure you have Python 3 installed. You can download it from python.org.
- Docker and Docker Compose: Install Docker and Docker Compose from docker.com.
- SMTP Server: A valid SMTP server is required for email delivery.
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate # For Windows, use: # source venv/Scripts/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Create a
.env.secrets
file with the following content:SMTP_PASSWORD='change-me'
Refer to the .env.secrets.example file for more details on configuration.
-
Run the application:
python worker.py
-
In another terminal, run the producer:
python producer.py
To deploy the RabbitMQ back-end service using Docker Compose, run:
docker compose up rabbitmq -d
You can access RabbitMQ in your browser at: http://localhost:5000.
To build and run the application in a Docker environment, use the following command:
docker compose up -d
If you are using Visual Studio Code, you can debug the application by pressing F5.
You can configure the application by modifying the files in the src/templates
directory and the src/config.py
file.
The configuration YAML files handle parameters to overwrite HTML templates. You can add and model new templates to send emails along with the parameters.
This project is licensed under the MIT License. See the LICENSE file for details.