Handle All Exceptions on a Controller

Create a custom alert message

Here we create an alert message to send out via text message. You might also
decide to include a picture with your alert message, maybe a screenshot of the
application when the crash happened?

Reading the Admins from the YAML File

Next we read the admins from our YAML file
and send alert messages to each of them with the private send_message method.

Sending a Text Message

There are the three parameters needed to send an SMS
using the Twilio REST API:
from:, to:, and body:. After the message is sent, we print out the phone
number we're texting. US phone numbers
can also send an image with the message.

Where to Next?

That's it! We've just implemented an automated server notification system
that can send you server alerts if anything goes wrong. If you're a Ruby
developer working with Twilio, you might want to check out these other
tutorials.