Skip to content

Instantly share code, notes, and snippets.

@bradstewart
Created February 18, 2015 21:56
Show Gist options
  • Save bradstewart/f3710f6cb4b9e1f4f57e to your computer and use it in GitHub Desktop.
Save bradstewart/f3710f6cb4b9e1f4f57e to your computer and use it in GitHub Desktop.
# initializers/twilio.rb
require 'twilio-ruby'
Twilio.configure do |config|
config.account_sid = account_sid
config.auth_token = auth_token
end
# app/services/twilio
module Twilio
extend self
def send_text(*args)
client.messages.create(args)
end
def client
@client ||= Twilio::REST::Client.new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment