Secret Santa Script

My partner comes from a large family. At Christmas time, rather than making everyone buy presents for everyone else (a rather expensive venture), we have a Secret Santa tradition. Unfortunately, as the years have gone on, it has become more difficult to organize for everyone to be in the one place to “pick a name out of a hat”.

And so, in my never-ending quest to remove the magic and joy from Christmas, I wrote a script to automatically assign everyone their Santa/Santee, and send them an SMS. It has a few cool things to it:

  • Allows you to prevent some people from being paired up. For example, you might not want a couple in the family to be assigned each other, because they’ll probably buy each other presents anyway.
  • Makes sure that everyone has a Santee before it starts sending messages, to prevent SMS spam.
  • Checks that all messages went through successfully.

I found that ValueSMS worked nicely for sending messages in Australia, you might need to use a different one for your country. Any gateway that has a HTTP(S) interface will do the job.

To set it up for yourself, you’ll need to do the following:

  • Edit the @names array to create a list of everyone participating (beginning line 12).
  • Edit the @people array to give the details of everyone participating (beginning line 20).
  • Edit in your ValueSMS username/password, or setup the HTTP(S) URL for your preferred SMS provider (beginning lines 101, 139).

Here it is, for your enjoyment:

0.1 – 2009-02-16:


  1. “And so, in my never-ending quest to remove the magic and joy from Christmas…”

    I rofl’d. All over the place.

    And I shall stop spamming your website. 🙂

Comments are closed.