Created
March 2, 2016 05:37
-
-
Save totzyuta/86bd470a2b5beff9f0fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'twilio-ruby' | |
class ShortMessageService | |
ACCOUNT_SID = 'xxxxxxxxxxxxxxxxxxxxxxxxx' | |
AUTH_TOKEN = 'xxxxxxxxxxxxxx' | |
FROM = '+xxxxxxxxx' | |
def self.send_short_message(to, body) | |
client = Twilio::REST::Client.new ACCOUNT_SID, AUTH_TOKEN | |
client.account.messages.create({ | |
from: FROM, | |
to: to, | |
body: body | |
}) | |
end | |
end | |
ShortMessageService.send_short_message("+xxxxxxxxx", "Hello by twilio") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment