Full Send SMS: Using Twilio, Python, and the WordPress API to Send Blog UpdatesKelsey Bernius
In case you missed it, SendGrid recently joined forces with Twilio, and the stoke level around the office is high as we start to acclimate and learn more about Twilio’s powerful product offerings, as well as their internal employee traditions.
One of those traditions is building an app on the Twilio platform, demoing it in front of the company, and receiving one of those coveted red track jackets in return.
The inner journalist in me loves picking up diverse, technical concepts and understanding these topics at a conversational scale. But sitting down and programming an application and then sharing it with others? Whoa whoa, slow down there. That seemed a bit bonkers to me…before I heard about Twilio Bootcamp.
There’s a bootcamp for that
Twilio Bootcamp provides a fleet of engineers to explain and empower any employee, no matter their background, to build their apps every step of the way.
So when this Twilio Bootcamp was recently offered at my home office in Denver, I thought this would be a great opportunity to build something for the blog program here at Twilio SendGrid.
I’m pleased to share that I’ve built an app that sends users an SMS message with a link to the latest Full Send blog post. It’s called Full Send SMS and I’m pretty excited about it.
Before I get too far along in explaining my app, I want to give a big thanks to Nick Funnell, Shanan Sussman, Bharat Murali, and Jingming Niu, who traveled out to Denver to teach the Bootcamp, who caught my syntax errors, and helped ensure a functioning app. Thank you!
Now, read on for more about how I built the app and how you can try it out for yourself!
Text me, maybe
To get ready, I purchased a phone number within my Twilio account and set up a development environment at Cloud9.
From there, I used Python’s conditional logic along with the WordPress REST API for Twilio SendGrid’s Full Send blog to automatically trigger a text when anyone texts the phrase “Full Send” to my Twilio phone number. The body variable was set by including “body = request.values[‘body’].
From there, here is the logic that I used:
Not surprisingly, I had (and still have) very little knowledge of Python before the Bootcamp and, although I’ve caught up on some peculiarities of the language, I would not have been able to build the app without the help of the Twilio Bootcamp teachers (cannot stress that enough). They were able to walk through, line by line, what the code was doing, as well as catch my errors and help troubleshoot when I messed up and forgot the quotes…again:)
However, the Twilio API is so powerful and relatively simple to use that even a nontechnical marketer such as myself can build an application.
Below is the complete code that I am using to run my app, Full Send SMS:
So give it a try! Text: Full Send to 928-433-2447 and you will get the latest blog post from the Full Send delivered to your phone. Make sure you are capitalizing both words and include a space between the words.
Whether you are building an SMS app, learning a new coding language, or even just trying to find an error in a certain portion of code, my best piece of advice, from a non-technical perspective, is to open your headspace and accept that you’re going to be out of your comfort zone for an uncomfortable amount of time. This is a good thing.
Having someone with the technical background to lean on for your questions is always great, but make sure that you at least try and figure out your problem or try to find your initial error first. Turns out there is a vast amount of documentation out there and an API for almost anything you can think of.
Although this is a fairly basic version of an application, in the near future, I’m hoping that I can add a little more color to the message, including a featured image so the text pops just a bit more. Stay tuned! And to learn more about programmable SMS, check out the Twilio offerings.