A Slack application to launch a Secret Santa

At JoliCode, we aim to keep a really great atmosphere in our offices and between our collaborators. In addition to our frequent JoliDrinks©, we organize a lot of internal events and Christmas is no exception. Each year, we have a great dinner and party to celebrate Christmas all together. During this party, we also run a Secret Santa. And we created a Slack application for that.

Santa is coming

Section intitulée what-is-itWhat is it?

It looks like Secret Santa is a tradition for a lot of companies, particularly in the IT sector. If you don’t know this ritual, it’s quite simple. Each person of the company is randomly assigned a coworker to offer a gift to, and nobody knows the author of the gift they will receive until the D-day. It’s a great occasion to enforce good relationships in your team, because everybody has to make it’s best to offer a nice gift to his coworker.

At JoliCode, we use to run the random draw one month before the party, which lets a fair amount of time to choose the perfect gift. We also set a max price of 20€ per gift, in order to avoid inequality with too cheap or too expensive gifts.

When arrives the ceremony, a first participant is selected (either randomly or the youngest or your best employee, as you want) to give his gift to his peer workmate. The latter will then give his gift to his workmate, etc, until the loop is over and everyone’s happy 😋

Section intitulée the-slack-applicationThe Slack application

Some years ago, we had to ask someone from outside the company to be our “Secret Santa”. We developed a quick & dirty PHP script that our Santa fellow would run to make the random draw and dispatch users by sending emails manually to everyone, to inform them of their peers.

Last year, we realized that because all our team uses Slack, we could simplify a lot the Secret Santa process. We could select participants with their Slack accounts and send them a private message instead of an email. This is how the original idea of Slack Secret Santa came down.

Home page

Basically, the application behavior is quite simple. It retrieves all the users of your team and you just have to select the ones you want to participe in the Secret Santa. You can also write an optionnal message to inform participants of any budget and date limit. Then we send a private message on Slack to each user to inform them of their peer name.

User selection

We felt that a lot of companies using Slack could be interested in this application so we released it in the wild. Because privacy concerns are really important to us, this application does not persist anything on disk, does not use web analytics, does not need any registration, does not collect any kind of personal information, nor does it send spam.

We are also big fans of open source, so it was obvious for us to release it publicly on GitHub. The first version was not really beautiful with its Bootstrap theme, but it worked well. And some large companies used it, which made us really happy.

Section intitulée technologies-behind-itTechnologies behind it

At JoliCode, we have a strong preference for Symfony. So it was a logical choice to quickly bootstrap this application. But because we knew that our application would not be too big, we choose to give a try to Symfony’s Micro Kernel. This simple trait allows us to keep the few services declaration, config and routing inside the kernel instead of splitting everything in a bunch of files. Due to the small set of features, we did not need any third party bundle. In fact, even among available Symfony bundles, we used only FrameworkBundle and TwigBundle that register basic Symfony and Twig services.

We expected a small amount of usages so we deployed our PHP application to a free Heroku Dyno. The 6 hours of required sleep was not a problem at all for us. Heroku’s support for PHP is excellent. It automatically detects the presence of a composer.json and run Composer commands to install your dependencies. You don’t need any special configuration apart specifying the web server in the Procfile. Heroku requires that sessions are not stored in the filesystem. So we setup a Redis server to store sessions with the Heroku plugin heroku-redis. It was quite easy to integrate the session handler from predis/predis in Symfony.

All the Slack private messages are sent synchronously. We didn’t want to introduce a queue management system to our simple stack. It would have been quite overkill because we did not expect lot of Secret Santa to be launched simultaneously and most of Secret Santa should contain less than 50 participants.

Slack private message send to users

Section intitulée the-2016-reworkingThe 2016 reworking

This year, we wanted to go a bit higher. We kept the Heroku hosting but we now run a “hobby” Dyno. This paid plan allows us to keep the small instance always up. No more delay to serve web page when the instance is sleeping.

I started to improve the design by removing Bootstrap and creating a better UI from scratch. It was less ugly but still not really “sexy”… until Baptiste gave it a bunch of awesomeness with a modern and lovely design and emoji (EDD, Emoji Driven Design, at his best!).

We also updated the whole application to use the latest versions of PHP and Symfony. Last year, someone wanted to be able to know the distribution of all Santa participants. It was not possible at that time because we did not store anything on disk. So we decided to fix this issue by storing the distribution in the session (which is by definition not persisted forever). But thanks to this, we can now propose the download of the summary just after all the private messages were sent.

Lastly, we developed a security in case an error occurred when sending Slack messages. You can now retry to send the remaining messages that were not sent. This is especially useful when network errors occur. This also fixes the problem for big Slack team that requires to send a lot of private messages over HTTP.

All of this reworking was made because we wanted a greater visibility for our app. And that’s why our main objective this year was to be present in the official Slack App Directory.

A better visibility

Section intitulée publishing-the-appPublishing the app

Publishing an application for the App Directory is far more easier now than some months ago because they simplified a lot the prerequisites. Before we submitted Slack Secret Santa to enter the directory, we had to make some changes in the application:

  • Display the “Add to Slack” button even if our app does not really integrates into Slack as it is a one-time usage;
  • Add a way for people to contact us in case of trouble. A link to GitHub issues was not enough, because it requires an account to report problem or ask for help, which was not acceptable for Slack validators. A mailto link in the footer of the website satisfied this condition.

Others conditions required that the home page clearly indicates how to use the application and how does it uses third party data. This was already in place and we just reworked them a bit with the 2016 redesign. After all conditions were met, Slack validated our application and we could successfully publish it in the App Repository.

App directory listing our application

In the heat of the moment, we also proposed the application on Product Hunt and it was well received. After a couple of hours, the application was even featured on Product Hunt homepage (which made Damien and I quite proud).

Product Hunt effect

*Hits on the Heroku platform

Section intitulée just-do-itJust do it

This year is the second time we use our app. If your team uses Slack and you plan to organize a Secret Santa, give it a try! It is really simple to use. If you didn’t plan a Secret Santa in your company… then you should really do (whether you use Slack or not). It’s a great and quite easy way to bring happiness, sharing and love with your coworkers.

Christmas happiness

If you have already used Slack Secret Santa this year or before, please let us now in the comments! We have no analytics, your feedback is the only way to tell 😄

Happy Christmas!

Commentaires et discussions

Nos articles sur le même sujet

Nos formations sur ce sujet

Notre expertise est aussi disponible sous forme de formations professionnelles !

Voir toutes nos formations

Ces clients ont profité de notre expertise