How to send SMS from Kynetx app?

How to send SMS to user using Kynetx App and Twilio?

+7
twilio krl
source share
2 answers

I had to do it manually using the Twilio API . Here is the rule that sends 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!" }; } 
+5
source share

Use the twilio:sms() function twilio:sms() . It takes one parameter, this is a string containing sms text. Also make sure that you 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" } } 
+1
source share

All Articles