Created
April 19, 2017 00:59
-
-
Save jeanpaulsio/2044cc0e6259ff8086b1b9ff5f3fb19c 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
class TwilioWrapper | |
attr_accessor :message, :phone, :from | |
def initialize | |
boot_twilio | |
end | |
def send_sms | |
@client.messages.create( | |
from: ENV['TWILIO_NUMBER'], | |
to: @phone, | |
body: "#{@from.upcase} WUPHF'D: " + @message | |
) | |
end | |
private | |
def boot_twilio | |
account_sid = ENV['TWILIO_ACCOUNT_SID'] | |
auth_token = ENV['TWILIO_AUTH_TOKEN'] | |
@client = Twilio::REST::Client.new account_sid, auth_token | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment