Skip to content

Instantly share code, notes, and snippets.

@leoallen85
Last active July 26, 2016 10:46
Show Gist options
  • Save leoallen85/784e46c175a2a0f4d484769afbf82690 to your computer and use it in GitHub Desktop.
Save leoallen85/784e46c175a2a0f4d484769afbf82690 to your computer and use it in GitHub Desktop.
class SMSController < ApplicationController
def create
user = User.find(params[:id)
twilio = Twilio::REST::Client.new(Rails.application.config.twilio_account_id)
args = {
to: user.phone_number,
body: params[:message]
}
client.messages.create(args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment