从Twilio发送消息是成功的,现在我希望能够从表单中输入消息正文的TO电话号码,但我不确定哪种方法最好。我想也许可以从另一个ViewController调用变量,但我不确定这是否有效,建议?
这是我的twilio控制器
public IActionResult Sendsms()
{
var accountSid = "XXXXXXXXXXXXXXXXXXXXXXXXXX";
var authToken = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX";
TwilioClient.Init(accountSid, authToken);
var to = new PhoneNumber("+XXXXXXXXXXXXXXX");
var from = new PhoneNumber("+XXXXXXXXXXXXXXXX");
var message = MessageResource.Create(to: to,
from: from,
body: "this is the ship that made the kessel run in 14 parsecs?");
return Content(message.Sid);
}