如何从 Kynetx 应用程序发送短信?

发布于 2024-10-03 14:50:14 字数 92 浏览 0 评论 0原文

如何使用 Kynetx 应用程序和 Twilio 向用户发送短信?

How would I send an SMS to a user using a Kynetx App and Twilio?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风筝有风,海豚有海 2024-10-10 14:50:14

我必须使用 Twilio 的 API 手动执行此操作。这是发送短信的规则:

rule send_sms {
  pre {
    SMS_url = <<https://#{keys:twilio().pick("$.account_sid")}:#{keys:twilio().pick("$.auth_token")}@api.twilio.com/2010-04-01/Accounts/#{keys:twilio().pick("$.account_sid")}/SMS/Messages>>;
  }
   http:post("#{SMS_url}")
     with params = {
       "From":"+18015555555",
       "To":"+18015555555",
       "Body":"Hello World via SMS!"
     };
}

I had to do this manually using Twilio's API. Here is a rule which sends an SMS:

rule send_sms {
  pre {
    SMS_url = <<https://#{keys:twilio().pick("$.account_sid")}:#{keys:twilio().pick("$.auth_token")}@api.twilio.com/2010-04-01/Accounts/#{keys:twilio().pick("$.account_sid")}/SMS/Messages>>;
  }
   http:post("#{SMS_url}")
     with params = {
       "From":"+18015555555",
       "To":"+18015555555",
       "Body":"Hello World via SMS!"
     };
}
來不及說愛妳 2024-10-10 14:50:14

使用 twilio:sms() 函数。它需要一个参数,它是一个包含短信文本的字符串。还要确保您已将 twilio 密钥放入应用程序的元块中。像这样的事情就可以解决问题:

rule send_sms {
    select when pageview ".*"
    {
       twilio:sms("Wow! I'm sending a text message") with to = "1234567890"
    }
}

Use the twilio:sms() function. It takes one parameter, it's a string containing the text of the sms. Also make sure you have put your twilio keys in the meta block of your application. Something like this will do the trick:

rule send_sms {
    select when pageview ".*"
    {
       twilio:sms("Wow! I'm sending a text message") with to = "1234567890"
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文