app/controllers/main_controller.rb
######################## Twilio commands SMS Texting and Phone Calls
Twilio commands SMS Texting and Phone Calls
Twilio commands SMS Texting and Phone Calls
def sendtext
  	@account_sid = ENV['TWILIO_SID']
  	@auth_token = ENV['TWILIO_AUTHTOKEN']
  	@client = Twilio::REST::Client.new @account_sid, @auth_token
  	if params[:message].blank?
  		@message = 'Hi there, this is OWL.'
  	else
  		@message = params[:message]
  	end
  	@client.messages.create(
  		:from => '+14847256467',
  		:to => '+14843472216',
  		:body => @message
  	)
  end
def sendtext @account_sid = ENV [ 'TWILIO_SID' ] @auth_token = ENV [ 'TWILIO_AUTHTOKEN' ] @client = Twilio :: REST :: Client . new @account_sid , @auth_token if params [ :message ] . blank? @message = 'Hi there, this is OWL.' else @message = params [ :message ] end @client . messages . create ( :from => '+14847256467' , :to => '+14843472216' , :body => @message ) end
Twilio commands SMS Texting and Phone Calls
Twilio commands SMS Texting and Phone Calls