Created
February 26, 2015 03:20
-
-
Save jarodreyes/1e7c0e01711b06ae368e to your computer and use it in GitHub Desktop.
3rdSpace Candy Machine
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
# Register a subscriber through the web and send verification code | |
route :get, :post, '/sms-register' do | |
@phone_number = Sanitize.clean(params[:From]) | |
@body = params[:Body] | |
puts @error | |
if @error == false | |
user = AnonUser.first_or_create(:phone_number => @phone_number) | |
if not @body.nil? | |
user.messages.create(:body => @body) | |
user.save | |
end | |
end | |
@msg = "Hi! I am the candy machine. Please let me know what would you like to be in the candy machine next month?" | |
message = @client.account.messages.create( | |
:from => @cowork_number, | |
:to => @phone_number, | |
:body => @msg | |
) | |
puts message.to | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're the man, Jarod.