How do I use Twilio to receive text messages from users and reply to that text with a message?

人走茶凉 提交于 2019-12-04 11:30:05
Carter Rabasa

Assuming your business logic doesn't take that long to execute, it's pretty simple to process a text and send a response. Here are the core steps:

  1. Grab the twilio-ruby helper library.
  2. Point your SMS Url to the Rails controller/action you'd like to invoke
  3. Process the incoming request & execute your business logic
  4. Instead of returning HTML, return TwiML

Here's a link to a simple app that does just this:

https://github.com/crabasa/twilio-rails-demo

Update: I've written two detailed blog posts on integration Twilio into a Rails 4.x app: Part 1 and Part 2.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!