Send SMS messages like emails in Rails with Textris

The Twilio Ruby helper library makes sending SMS messages with Ruby really easy. In fact, it’s as simple as:

But in the context of a web application this just isn’t very “Rails” is it? Are we mixing views and controllers? Where’s the separation of concerns? What about localisation? If you’ve thought this, or even if you’re just interested in better ways to send SMS messages in your… Read More

Real Time Rails 4: Using Server-Sent Events with Authy OneTouch

Server-Sent Events (SSE) are real-time events sent from a server and received by a browser, perfect for updating the front end when a server receives a webhook. We’re going to look at how to use SSE to implement Authy OneTouch using Rails 4. Our end result should look a bit like this: Authy OneTouch Two factor authentication usually means copying a bunch of numbers from your phone to… Read More

Add Chat to a Rails App with Twilio Programmable Chat

IPMessaging

There’s more to chat than sending messages back and forth. There’s chat history, typing indicators, read receipts and integrating with third party software. On top of all that, there’s making sure it all works across both web and mobile devices. Twilio Programmable Chat is a set of APIs and SDKs that provide everything you need to build cross-platform messaging. In this tutorial we’ll get started with Programmable Chat by adding simple chat… Read More

Delay API calls to Twilio with Rails, Active Job and Sidekiq

Performance is key in web applications. Snappy websites make for better user experiences, higher conversion rates and better user retention. A swift application response causes less stress on servers trying to respond to many users too. There are many ways to improve the performance of a web application in Rails and I want to look at one of those today. Performing long running, blocking tasks during… Read More

How to build SMS Phone Verification in Rails 4 using AJAX

sms-verification-featured-image

You’ve undoubtedly done something like this before: That’s the SMS phone verification for AirBnB, which uses Twilio to allow hosts and guests to chat without sharing their actual phone numbers. In this tutorial, we’ll use Twilio SMS and AJAX to add phone verification into a Rails 4 app. Warning: There are a bunch of great reasons to grab a user’s phone number, but if your end goal is two-factor authentication, you… Read More

Twilio on Rails Part 3 – Adding Contextual VOIP Using WebRTC to Your Rails 4 App

twilio_on_rails2

Welcome to the final part of our series on integrating Twilio with your Rails 4 app. In Part 1 we walked through signing-up for a free Twilio developer account, getting a phone number and processing an inbound phone call. In Part 2 we secured the webhooks, used Twilio’s REST API to send outbound SMS and MMS and processed delivery receipt notifications. In this post we are… Read More

Gmail API and Rails – Get emails, labels and message details

gmail-api

I turned off Gmail notifications on my phone a while ago, mostly because this tweet accurately sums up my email situation: But there are some emails that you want to know about right now. For instance, say The Doggfather wants to invest your startup. That’s an email worth interrupting dinner for. Text messages are great for alerts like this. With the GMail API and Twilio SMS… Read More

An easier way to write TwiML templates in Rails and Sinatra

sinatra

We recently had a discussion between some members of the Developer Evangelism team about how best to write TwiML within a Ruby application. There are a few methods available to a developer right now: handwrite the XML (ugh!), use the builder gem or take advantage of the twilio-ruby gem’s Twilio::TwiML::Response object. Writing XML by hand can get messy very quickly. Building up a Twilio::TwiML::Response gets unwieldy… Read More

Twilio on Rails Part 2 – Securing Your Rails 4 App and Sending SMS/MMS

twilio-on-rails2-640x265

Welcome to Part 2 of our series on integrating Twilio with your Rails 4 app. In Part 1 we walked through signing-up for a free Twilio developer account, getting a phone number and processing an inbound phone call. In this blog post, I’ll walk you through: Securing your webhooks so that only Twilio may access them Using Twilio’s REST API to send outbound SMS and MMS… Read More