应用程序使用REST API发送消息,但就其而言,“to”号码被硬编码到应用程序中。我希望该号码是用户输入的值。
HTML:
<!DOCTYPE html>
<head>
<title>Joe's Web App</title>
<link rel="stylesheet" type="text/css" href="index.css" media="screen"/>
</head>
<body>
<div class="content">
<div class="words">
<h1>My Name</h1>
<p>
Insert your number below to recieve a text!
</p>
</div>
<input type="tel" placeholder="Phone Number" name="number">
<input type="submit">
</div>
</body>
红宝石:
require 'rubygems'
require 'twilio-ruby'
account_sid = 'AC26b29f734e8145f6df3497eb6ca50205'
auth_token = 'my auth token'
@client = Twilio::REST::Client.new account_sid, auth_token
@client.account.messages.create({
:from => 'Twilio Number',
:to => 'phone number',
:body => 'Hey this is Joe!',
})
答案 0 :(得分:0)
原始代码应该是,
Fill