Book Image

CoffeeScript Application Development Cookbook

By : Mike Hatfield
Book Image

CoffeeScript Application Development Cookbook

By: Mike Hatfield

Overview of this book

Table of Contents (18 chapters)
CoffeeScript Application Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sending SMS and MMS messages


In this recipe, we will demonstrate how to send SMS text messages using the very popular Twilio service and the APIs it provides.

To use the Twilio service, you must first have an account. You can sign up for a free trial on their website at http://www.twilio.com. Once you have signed up, you can go to your Account page to get account SID and auth token. These will be used by your application to communicate with the Twilio service.

Short Message Service (SMS) messages are text-based messages that are limited to 160 characters. These are messages that can be received by almost all mobile phones whether they are a smart phone or a feature phone.

In this recipe, I will demonstrate how to send an SMS text message from our application.

Getting ready

Once we have a Twilio account, we can use the official npm package to send SMS messages. To begin, install the twilio package with the following command:

npm install twilio --save

Next, create a configuration file called twilio...