This commit is contained in:
2015-09-12 15:37:05 -05:00
commit cb7e47a466
77 changed files with 1374 additions and 0 deletions

21
app/workers/sms.rb Normal file
View File

@@ -0,0 +1,21 @@
class SmsSender
attr_accessor :from
attr_accessor :to
attr_accessor :message
def initialize args_as_hash
@from = args_as_hash["from"] ||= ENV["twilio_number"]
@to = args_as_hash["to"]
@message = args_as_hash["message"]
end
def send!
twilio.messages.create(from: @from, to: @to, body: @message)
end
private
def twilio
Twilio::REST::Client.new ENV['twilio_sid'], ENV['twilio_token']
end
end