/**
  * Sends a text message (SMS) using the Clickatell API
  *
  * @param string $to
  * @param string $from
  * @param string $to
  */
 public function send($to = NULL, $from = NULL, $message = NULL)
 {
     // Get Current Clickatell Settings
     $clickatell = ORM::factory("clickatell", 1)->find();
     if ($clickatell->loaded) {
         // Create Clickatell Object
         $new_sms = new Clickatell_API();
         $new_sms->api_id = $clickatell->clickatell_api;
         $new_sms->user = $clickatell->clickatell_username;
         $new_sms->password = $clickatell->clickatell_password;
         $new_sms->use_ssl = Kohana::config('core.site_protocol') == 'https';
         $new_sms->sms();
         $response = $new_sms->send($to, $from, $message);
         // Message Went Through??
         return $response == "OK" ? TRUE : $response;
     }
     return "Clickatell Is Not Set Up!";
 }
Example #2
0
 public function send($to = NULL, $from = NULL, $message = NULL)
 {
     // Get Current Clickatell Settings
     $clickatell = ORM::factory("clickatell", 1)->find();
     if ($clickatell->loaded) {
         // Create Clickatell Object
         $new_sms = new Clickatell_API();
         $new_sms->api_id = $clickatell->clickatell_api;
         $new_sms->user = $clickatell->clickatell_username;
         $new_sms->password = $clickatell->clickatell_password;
         $new_sms->use_ssl = false;
         $new_sms->sms();
         $response = $new_sms->send($to, $from, $message);
         // Message Went Through??
         if ($response == "OK") {
             return true;
         } else {
             // Send the Error Code Back
             return $response;
         }
     }
     return "Clickatell Is Not Set Up!";
 }
Example #3
0
 /**
  * Retrieves Clickatell Balance using Clickatell Library
  */
 function smsbalance()
 {
     $this->template = "";
     $this->auto_render = FALSE;
     $clickatell = ORM::factory("clickatell")->find(1);
     if ($clickatell->loaded) {
         $clickatell_api = $clickatell->clickatell_api;
         $clickatell_username = $clickatell->clickatell_username;
         $clickatell_password = $clickatell->clickatell_password;
         $testsms = new Clickatell_API();
         $testsms->api_id = $clickatell_api;
         $testsms->user = $clickatell_username;
         $testsms->password = $clickatell_password;
         $testsms->use_ssl = false;
         $testsms->sms();
         // echo $mysms->session;
         echo $testsms->getbalance();
     }
 }