Skip to content

Instantly share code, notes, and snippets.

@philiph
Created April 11, 2015 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philiph/e291da86603557c9e666 to your computer and use it in GitHub Desktop.
Save philiph/e291da86603557c9e666 to your computer and use it in GitHub Desktop.
Sending an SMS with Twilio's Ruby library
source "https://rubygems.org"
ruby "2.1.2"
gem 'twilio-ruby'
#!/usr/bin/env ruby
require 'twilio-ruby'
# put your own credentials here
account_sid = 'xxx'
auth_token = 'xxx'
# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new account_sid, auth_token
puts "Sending SMS..."
@client.account.messages.create({
from: '+614xxxxxxxx',
to: '+614xxxxxxxx',
body: 'This is a test message from my Twilio ruby app.'
})
puts "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment