Skip to content

Instantly share code, notes, and snippets.

@jonmarkgo
Created May 3, 2013 04:33
Show Gist options
  • Save jonmarkgo/5507221 to your computer and use it in GitHub Desktop.
Save jonmarkgo/5507221 to your computer and use it in GitHub Desktop.
post "/receivesms" do
timeline_item = @glass.timeline.insert.request_schema.new({
:sourceItemId => params[:SmsSid],
:menuItems => [{:action => "REPLY"}, {:action => "READ_ALOUD"}],
:html => "<article>\n <section>\n <div class=\"text-auto-size\" style=\"\">\n <p class=\"yellow\">SMS from #{params[:From]}</p>\n <p>#{params[:Body]}</p>\n </div>\n </section>\n <footer>\n <div><img src=\"http://i.imgur.com/VM8Jji2.png\"></div>\n </footer>\n</article>",
:speakableText => params[:Body],
:title => "SMS from #{params[:From]}",
:notification => {:level => "AUDIO_ONLY"}
})
result = @client.execute(
:api_method => @glass.timeline.insert,
:body_object => timeline_item
)
twiml = Twilio::TwiML::Response.new
twiml.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment