Wedding at Scale: How I Used Twilio, Python and Google to Automate My Wedding

September 3, 2016 was just another day for most of the world but to me it will always be memorable as the day that I married my partner.

There are many different aspects to consider while planning a wedding. Food, decor, table fixtures (oh yes these are separate from decor), flowers, accommodation, transportation, entertainment, and location. Whilst there are many unknowns when planning a wedding, I could be sure of one thing. In weddings there are a lot of lists, nested lists, and more lists as far as the eye could see. As I stared at the growing number of items I began to wonder if there was a better way? It all felt so manual and full of inefficiencies. There had to be some aspects that technology could improve.

You may be surprised but inviting people to weddings is expensive (over three hundred and eighty pounds), as you need to send out both ‘Save the date’ cards and a subsequent invite with specifics about the wedding. It is also slow, as you have to send it all via post. It’s time intensive to chase people to see if they received the invite and if they’d like to come to a party with free food and drink – surely an automatic yes? Finally, invites are not environmentally friendly as they are one time use and easily lost or misplaced.

Back to lists. The guest list is split into a few sections:

  1. A list of who you’d liked to come
  2. A list of people who have replied to your R.S.V.P
  3. A list of people who have replied yes
  4. A list of people who have replied yes and selected a food choice

But lists are good. They have predefined requirements and responses which make them a great candidate for automation.

Message In a Bottle

Irrespective of age, I was sure everyone in the wedding list had a mobile phone and that meant it was Twilio time. If you want to skip to the code, you can view the repo on GitHub.

SMS was perfect for my needs. I could configure outbound mass messaging and handle responses quickly and efficiently. While sketching out an MVP and considering a database, I wanted something easy to share and didn’t want to waste time building views. Stumbling upon the gspread python library enabled me to read and write to a google spreadsheet. Whilst not the fastest option, it was certainly flexible enough and provided an easily accessible and readable output.

For the initial R.S.V.P I created a spreadsheet with these columns:

  • Name
  • Telephone_number
  • Confirmation_status
  • Contact detail status
  • Message_count (Amount of messages sent to guest, this comes in handy later)

After the main data entry was completed, I used gspread to iterate through the list and send an SMS to each guest that had a mobile number associated with it:

Sheets.py

As SMS can look a tad plain, I added in some unicode to spice things up. Here is what the message looked like to the lucky invitees:

 

IMG_4729.PNG

 

Next, I used Flask as my web server and set my Twilio Messaging Request URL to point to a /messages url and created simple if statements to parse replies (yes, no):

hello_guest.py

 

IMG_4740.PNG

IMG_4741.PNG

 

The first message was sent 8:37am on the 19th February and the first confirmation was received three minutes later at 8:40am. By 9:38am I had received twenty three confirmations, that’s a 32% acceptance rate! Two days after the initial mass message, we had 58% of guests confirmed! In spite of the clear success, my soon to be wife wasn’t completely sold on my SMS as a wedding invite service (SAAWIS?), so I decided to add some functionality to my app.

Statistics! I could calculate the live attendance list and return it on demand, giving a would be bride instant feedback on how the guest list was shaping up. The code was pretty simple as I had already set up some rudimentary counters in the spreadsheet and so it was just a case of grabbing the contents of these cells and adding them to an SMS:

hello_guest.py

Here is the resultant SMS message:
IMG_4731.PNG

 

Not exactly pretty, but pretty useful.

The fact that Lauren could now keep track of attendance was a stress reliever. From that point forward it was all systems go and SMS was integrated into as many facets of the wedding as possible. Some were obvious, such as sending a notification SMS when the wedding website (powered by Heroku naturally) went live, sharing of gift lists and others I am still proud of today.

Food, Glorious Food

After setting up the R.S.V.P list, the area that is often most delayed is getting guests food choices confirmed You’d be surprised at how hard it is to get people to choose free food. The first step was to send out another SMS telling those guests that had accepted to visit the website and choose their food options via a Google form. Pretty standard stuff however, the form was set to populate the same workbook as attendees. This meant I now had spreadsheets of accepted guests, and those that had filled out the food selection form. Ordinarily I would then have to wait for guests to slowly choose their meals, but my wedding was powered by Twilio and that meant I could chase people with minimum effort.

The data needed to match both spreadsheets on the guest name and update the guests food choice status if there was a match. This required a little extra work but once the code was sorted I could batch run the script on demand and get the latest status of my attendees choice at the end via SMS:

food.py

Now that there was a confirmed list of guests and a growing list of food choices, it made sense to make those stats public via the main application. All that was needed was grab the contents of the relevant cells and reply with an SMS:

Hello_guest.py

 

IMG_4733.PNG

 

This was very handy in keeping the wedding caterers informed of our progress and provided actionable data on who had not made their selection. Chasing guests was another candidate for automation. Simply iterate through the list of attendees and find the naughty guests that had not chosen a meal option and send them a message!

Chase.py

 

IMG_4735.PNG

 

The big day approached faster than we could imagine. The only thing left to do was send a final SMS to remind guests of the basic details and to arm themselves with an umbrella to ward off the typically rainy British summer time:

 

IMG_4742.PNG

In Summary

Weddings are never simple affairs and it can feel like a lot of aspects are outside of your control. Automating certainly made my life easier by providing a direct channel with our guests and a myriad of different ways I could track, nudge and poke them into responding. It helped us become proactive over a notoriously time consuming aspect of the wedding, freeing us to focus on other important areas of the big day.

Building scalable solutions to complex problems is never easy, even in its final form my application was fragile at times. I had planned to build out a more complete solution with data visualizations on progress, voice integration and less reliance on CLI scripts but time got the better of me. Overall I’m happy with how it worked out. No communication system is perfect. You need to implement the channel that best fits your audience, be it SMS, Voice, Chat, Video, or semaphore.

If you want to talk about wedding automation, I’m @seektom on Twitter.

  • refi64

    > Message_body = <span

    Did you mean to put quotes here…?

  • ዮሐንስ

    Congrats, you two look so beautiful!!

  • Lauri W. Ahonen

    All that scaling machinery, and you end up marrying one (1) person. Remember, always verify your idea before you start scaling!

    • nisar shaik

      Good one!!!

    • Nice and evil!!

    • Bill Du

      That’s the whole point. The length he went to create this now gives him so much publicity.

    • ZhiminWu

      LOL

    • Sumit Bisht

      Tha’t the idea behind publishing this project.

  • Camilo Jiménez

    Good one mate… I did everything with WordPress, g forms, and FB event… Another good move is to use Moments (Facebook) to share images among everyone.

  • Camilo Jiménez

    Another issue was the table setup (where to sit my friends, family, etc) … I thought about a combinatory problem and an Excel spreadsheet but at that time, I had so much to worry hehehhee

  • Drew

    Congratulations Tom and Lauren! I love the idea.

    I’m not sure if your semaphore link at the end was tongue in cheek, or if you meant this kind of semaphore: https://en.wikipedia.org/wiki/Flag_semaphore

  • One thing I’m interested in hearing is how it was received by the guests. Did they prefer the invite coming via text? What was their feedback on the whole process? I’m just wondering if the lack of a human touch (usually through writing cards) changed anything.

  • lucky man, beautiful bride~~~~

  • Nithin M

    a faster alternative to gspread is pygsheets, not very stable though

  • Alex Goh

    https://www.littleknot.com has exactly what everyone is talking about – sending online invitation via sms, seating plan, one-click rsvp…etc

    I built this site initially for my own wedding. Do check it out!

  • Simon Sotak

    I’m guessing the undecided meals were vegetarians 😜

    • Andrei Kropotoff

      There is never any love for vegans :)

  • plata_o_plomo_medellin

    hahahahahah retarded post

  • Simon Ndunda

    Next time, try http://www.echomobile.org/, an online app that allows you to setup these kind of SMS workflows. A great option for those who can’t code too.