Exemplo n.º 1
0
 /**
  * Sends a message to a collection of recipients (or one recipient)
  * 
  * THIS ABSOLUTELY REQUIRES THAT THIS MODEL BE BUILT USING THE _load METHOD
  *
  * @access public
  * @param string $message The message to send
  * @param array $recipients An array of recipients to send to
  * @param string $sendtime A timestamp to schedule the message for
  * @return boolean
  */
 public function send($shortcode)
 {
     $this->_writeLog("Message->Send() called...");
     // General concept here is simple... load up a message and all of the
     // recipients based simply on the message id from the queue
     if ($this->id && $this->body && $this->recipients && $this->reportingkey1 && $this->reportingkey2) {
         $this->_writeLog("All message components checked");
         $sender = new Application_Model_Smsoutbound($this);
         //         $sender = new Application_Model_Synsmsoutbound($this);
         $this->_writeLog("Sender built");
         if (($return = $sender->send($shortcode)) === false) {
             $this->error = $sender->error;
         }
         $this->_writeLog("Sender->Send() called from the message...");
         return $return;
     }
     $this->_writeLog('Missing required components of the message: ' . serialize($this));
     $this->error = 'Missing required components of the message: ' . serialize($this);
     return false;
 }