This project will automatically "pull from a hat" a recipient for every secret Santa and send a notification email to each Santa's inbox of who their gift recipient is π
It ensures that no one knows who their secret Santa is... not even you β unless you really want to know!
Clone the repository and install dependencies via poetry with poetry install
, then activate the virtual environment via the poetry shell
command.
Make your desired modifications to the config.py
configuration file (mostly the email template, optionally a lookup of anyone who should not be someone elses Santa).
Create a .env.secret
file with a structure like that of .env.shared
and specify:
- the SMTP settings, as specified by your SMTP host;
- the list of secret Santas (names and email addresses).
python ./secret-santa-mailer.py
This will read the configuration file and perform a "dry run" of the various
pairings between secret Santas and recipients. It will generate an output file
as specified by the secret_santa_record_file
setting in config.py
.
This record file is saved as secret-santa-record-file.txt
by default.
Send a test email to confirm that the SMTP configuration is set up correctly:
python ./secret-santa-mailer.py --send-test-email you@example.com
If it runs without any error, then you're ready to send the secret Santa emails.
python ./secret-santa-mailer.py --official
This will sequentially send emails to everyone and record them into the file specified
by the secret_santa_record_file
setting in config.py
.
Enjoy, and have a Merry Christmas! π