SENDING SMS

I wonder if anybody had ever tried to send SMS message from SC App ? Of course this would require some 3rd party service (I’m aware of that) but I’m looking for suggestions or examples.
The main idea for what I need would be the same as sending email except the message should go to the phone as TXT

ARTHUR

Hello Aka,

I have never tried sending SMS with SC, but I have seen some libraries that are not difficult to use. For example:

  1. Clickatell: It is robust and is known in a ton of countries. With this guy you can:
  • Using email to send SMS, this is cool if you do not want to dirt your hands in code.
  • Using an API: I would like to tell you more about this, but the developer’s guide is closed for visitors.
  1. Twilio: I have seen its docs and It looks pretty easy to integrate.

For both cases you need to register and obtain some tokens to be used in your side. Let me show you and example how Twilio could be integrated in SC.

  1. Download Twilio-PHP library from their page. Upload them in ScriptCase using Tools -> External Libraries. I will assume that this library will be named to “twilio”.
  2. Create a blank application named “SEND_SMS”.
  3. Import Twilio library using ScriptCase macro, the main file is Services/Twilio.php:
sc_include_library("sys", "twilio","Services/Twilio.php", true, true);
  1. Now, using your credentials an library to send a message:

// your credentials, this tokes are found in you account
$AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY";

// Preparing the library
$client = new Services_Twilio($AccountSid, $AuthToken);

// Details of the new SMS
$name = "O'Ren";
$number = "+14158675309";

// Sending a message
$sms = $client->account->messages->sendMessage($number, "Hey {$name}, Monkey Party at 6PM. Bring Bananas!");

// Display a confirmation message on the screen
echo "Sent message to {$name}";

Now, try to access SEND_SMS in browser to test the service. Above I am setting $name and $number directly, but you can pass that data via $_POST, or import the library in your applications and send message from events.

I have build working sms for a US customer with an american provider. It’s just php as useual. B.t.w. in US you can also send sms by sending email to the phonenumber using the correct carrier syntax. To find the carrier there are also third parties that provide api’s.

thank you guys, I will study this info and hopefully return with some results here.
ART

auducom - you stated this “in US you can also send sms by sending email to the phonenumber using the correct carrier syntax”
do you have any links or more info on that ?

probe la misma sintaxis en un blank y me da el siguiente error: [LEFT][SIZE=16px]Parse error: syntax error, unexpected ‘use’ (T_USE) in C:\Program Files\NetMake\v9\wwwroot\scriptcase\app\royalpartsnuevo\blank_send\index.php on line 1633 [/SIZE][/LEFT]

sc_include_library(“sys”, “twilio”,“Services/Twilio.php”, true, true);
$AccountSid = “XXXXXXX”;
$AuthToken = “XXXXXX”;

// Preparing the library
$client = new Services_Twilio($AccountSid, $AuthToken);

// Details of the new SMS
$name = “O’Ren”;
$number = “+XXXXX”;

// Sending a message
$sms = $client->account->messages->sendMessage($number, “Hey {$name}, Monkey Party at 6PM. Bring Bananas!”);

// Display a confirmation message on the screen
echo “Sent message to {$name}”;