Wedding at Scale: How I Used Twilio, Python and Google to Automate My Wedding
Time to read: 5 minutes
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:
- A list of who you’d liked to come
- A list of people who have replied to your R.S.V.P
- A list of people who have replied yes
- 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:
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:
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):
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:
Here is the resultant SMS message:
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:
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:
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!
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:
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.
Related Posts
Related Resources
Twilio Docs
From APIs to SDKs to sample apps
API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.
Resource Center
The latest ebooks, industry reports, and webinars
Learn from customer engagement experts to improve your own communication.
Ahoy
Twilio's developer community hub
Best practices, code samples, and inspiration to build communications and digital engagement experiences.