我以这种方式为来自 kannel 的短信应用程序的交付报告设置了交付 url;
id = rand(36**8).to_s(36)
https://www.xxxxxxxx.com/messages/delivery?id=#{id}&type=%d
在消息控制器中是
def delivery
sent_message = SentMessage.find_by_ref(params[:id])
if params[:type] == 1
sent_message.delivery = "Delivered"
sent_message.save()
elsif params[:type] == 2
sent_message.delivery = "Delivery Failure"
sent_message.save()
else
sent_message.save()
end
从我的路线文件中,以下是该行
match 'message/:id/delivery' => 'messages#delivery', :as => :deliver
有人帮我指出错误,因为根本没有报告交付报告。
非常感谢