Skip to content

Commit

Permalink
secretsanta.pl: Script to compute random secret santa exchanges
Browse files Browse the repository at this point in the history
  • Loading branch information
mgulick committed Dec 14, 2020
0 parents commit e53b612
Show file tree
Hide file tree
Showing 7 changed files with 1,284 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*~
participants.yml
emailconf.yml

674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Secret Santa Randomizer and Mailer
==================================

`secretsanta.pl` is a script used to set up a secret santa gift exchange. It
reads a list of participants from a YAML file, matches them randomly, and
optionally sends an email to each participant informing them of their match.

Setup
=====

This program doesn't need to be installed, however it does have some perl
dependencies. You should have a local perl 5 installation from your system,
which should include CPAN. If you don't have `cpan` installed and configured,
you can configure a local CPAN installation in your home directory:

```
cpan App::cpanminus
```

After installing cpanminus, you will need to re-source your `~/.bashrc`.

Once you have `cpanm` installed, just run:

```
cpanm --installdeps .
```

After that completes, you should be able to run `secretsanta.pl -h`.

Usage
=====

See the full help by running `secretsanta.pl --man`.
7 changes: 7 additions & 0 deletions cpanfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
requires 'Email::Simple';
requires 'Email::Sender::Simple';
requires 'Email::Sender::Transport::SMTP';
requires 'MIME::Base64';
requires 'Authen::SASL';
requires 'File::Slurp';
requires 'YAML';
35 changes: 35 additions & 0 deletions emailconf.yml.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- mode: yaml -*-
# vim: set expandtab ts=4 sw=4:
# vim: set syntax=yaml:
---
msghdr:
from: 'Secret Santa <[email protected]>'
subject: '[Confidential] Your Secret Santa Info'
msgbody: |
Hi @FROM@,
Thanks for participating in this year's Secret Santa! We will meet on a
yet-to-be-finalized date to open gifts together and revel in the glory. Expect
another email soon confirming a date and time.
You have been chosen as the secret santa for: @TO@

Their mailing address is:
@TO_ADDRESS@

As a reminder, here are some guidelines:

* Keep the gift in a reasonable price range, including any shipping costs.
* Please be sure the gift will arrive before Christmas.

Happy Holidays!
smtpconf:
# Arguments to Email::Sender::Transport::SMTP
# FYI Depends on CPAN modules MIME::Base64 and Authen::SASL
host: smtp.example.com
ssl: 1
port: 465
# SMTP username
sasl_username: '[email protected]'
# SMTP password
sasl_password: asdf1234
39 changes: 39 additions & 0 deletions participants.yml.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- mode: yaml -*-
# vim: set expandtab ts=4 sw=4:
# vim: set syntax=yaml:
---
participants:
- name: Alice Appleseed
email: [email protected]
address: |-
Alice Appleseed
c/o Secret Santa
1500 Main Street
Anytown, USA 12345
excludes: []
- name: Bob Roberts
email: [email protected]
address: |-
Bob Roberts
c/o Secret Santa
1500 Main Street
Anytown, USA 12345
excludes: []
- name: John Doe
email: [email protected]
address: |-
John Doe
c/o Secret Santa
1501 Main Street
Anytown, USA 12345
excludes:
- Jane Doe
- name: Jane Doe
email: [email protected]
address: |-
Jane Doe
c/o Secret Santa
1501 Main Street
Anytown, USA 12345
excludes:
- John Doe
Loading

0 comments on commit e53b612

Please sign in to comment.