0
我按照指南here設置了一個成功接收並響應發送到我的Twilio帳戶的文本的sinatra應用程序。Twilio - 在Ruby中保存SMS正文,sid和發件人
require 'sinatra'
require 'twilio-ruby'
post '/receive_sms' do
content_type 'text/xml'
response = Twilio::TwiML::Response.new do |r|
r.Message 'Message recieved'
end
response.to_xml
end
如何檢索郵件的SMS正文,發件人和SID並將它們存儲爲變量?例如:body = "Test message"
我已經嘗試添加response.text
來返回xml響應,並可能解析輸出,但沒有任何運氣。
非常有幫助。謝謝! – atwalsh