Ejemplo n.º 1
0
 /**
  * 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!";
 }
Ejemplo n.º 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!";
 }