This is example of async mailer. Project is implemented as 2 separate tasks, running in parallel. First task constantly checking new user emails, second task is sending emails. If nothing left, tasks stop but restart every minute using cron.
PHP 8.2+ required.
Set enough MySQL max_connections = MAX_PARALLEL_PROCESSES_COUNT/50 (200 connections for current config).
Add correct database credentials to config.php, and run 2 processes using console commands:
php mailer.php validate
php mailer.php send
Project built with the docker support, for the ease of debugging.
To start mysql server, execute:
docker compose up
To drop images (for re-seed, for example):
docker-compose down --rmi all
Fill database with test data:
php mailer.php seed
Config values are stored in config.php.
Add cron tasks from crontab file on selected server / container.