Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would I send an SMS from a Kynetx app?

Tags:

twilio

krl

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

like image 516
Jessie A. Morris Avatar asked Nov 19 '10 21:11

Jessie A. Morris


People also ask

Is twilio an app?

Twilio Frontline is a pre-built application with customizable workflows that integrates with any CRM or customer database, and is available for iOS, Android, and web.


2 Answers

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!"
     };
}
like image 74
Jessie A. Morris Avatar answered Oct 04 '22 23:10

Jessie A. Morris


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"
    }
}
like image 34
Alex Avatar answered Oct 05 '22 00:10

Alex