Skip to content

This program assigns secret santas and emails everyone who they have.

License

Notifications You must be signed in to change notification settings

chuck-alt-delete/secretSanta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secret Santa

This program assigns secret santas and emails everyone who they have. Each person has a "noSanta" list of people for whom they can't be secret santa. For example, you might not want to allow spouses to have each other for secret santa. In our house, you can't have your spouse and you can't have the same person you had last year.

For more info about sending emails with python, see http://naelshiab.com/tutorial-send-email-python/. Also note that gmail requires you to create an application specific password for authentication. Go to https://myaccount.google.com/apppasswords and create an application password for this app.

For now, you have to go back to the outbox for last year to update the "lastYear" field for each member of the family. There is a TODO to automatically update the json for next year.

Instructions

  1. Clone this repo.
  2. Create a gmail API key and create a file called santaDataSecrets that looks like:
    [email protected]
    password=myapikey
    
  3. Use the sampleData.json as a template to create a json file for your user data (names and emails). By convention, json files that start with santaData are ignored in git to protect your users' email addresses from source control. Example: santaData2021.json. Keep these secret files locally or in secure storage (dropbox, lastpass, bitwarden, etc.).
  4. Edit the file and secrets_file variables in secretSanta.py to point to your user json file (e.g. santaData2021.josn) and secrets file (santaDataSecrets).
  5. Run the python script to send the emails:
    python3 secretSanta.py
  6. Don't peek at your outbox (until next year when you have to make a new santaData json file)!

About

This program assigns secret santas and emails everyone who they have.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages