Quickly draw names from secret santa and send emails telling people about their own.
- Install Deno. The latest version should work, but this is as of 2022-11-25 and I am using v1.28.1.
- Install the AWS CLI. You should configure a profile called
SecretSanta
, that has enough IAM permissions to send emails with Amazon SES. Or change the loaded profile to something else you want. - Change the email template and the origin email address to whatever you want, and whatever email address you control.
- Add a
data.json
file in the root of the directory and specify your input there:people
key has people's names and emails, andpools
has the people that can't gift each other. Something like the following:
{
"people": [
{ "name": "Alice", "email": "[email protected]" },
{ "name": "Bob", "email": "[email protected]" },
{ "name": "Cathrine", "email": "[email protected]" },
{ "name": "Mike", "email": "[email protected]" },
{ "name": "Hannah", "email": "[email protected]" }
],
"pools": [
["Alice", "Cathrine"],
["Bob"],
["Mike"],
["Hannah"]
]
}
Run with deno run --allow-env --allow-read --allow-net main.ts
- If an assignment is impossible, such as if there are only two pools and three participants, you're gonna get stuck on an infinite loop.
- SES is gonna blow up if you don't have prod access or try to send through my email address