/** * Opts a subscriber out, used by STOP, QUIT and END * */ public function optOut() { //echo "I am here in keyword abstract"; // Check if this is a single folder subscriber first... $subscriber = new Application_Model_Subscriber(); $folders = $subscriber->getContainingFolders($this->_inbound->device_address, false); if ($folders && is_array($folders) && count($folders) == 1) { // Unsubsribe from this folder $this->optOutSubscriber($folders[0]->folderid, $this->_inbound->device_address); } else { $outbound = $this->_inbound->getReplytoMessage(); //echo $outbound->folderid; //die; if ($outbound && $outbound->folderid) { //$user = Zend_Registry::isRegistered('user') ? Zend_Registry::get('user') : new Application_Model_User($outbound->createuser); //$folder = new Application_Model_Folder($user, $outbound->folderid); $this->optOutSubscriber($outbound->folderid, $this->_inbound->device_address); } //$this->_keyword->deleteSubscriber($this->_sender); } }
public function optOut311($sms) { $subscriber = new Application_Model_Subscriber(); $folders = $subscriber->getContainingFolders($this->device_address, false); //echo $folders[0]->folderid; //echo "count folder".count($folders); ###################################### if ($folders && is_array($folders)) { // Unsubsribe from this folder foreach ($folders as $folder) { $this->optOutSubscriber1($folder->folderid, $this->device_address); } $this->confirmOptOut3($this->device_address, $sms); } else { $outbound = $this->getReplytoMessage(); //print_r($outbound); //echo "folderid".$outbound->folderid; //die; if ($outbound && $outbound->folderid) { $this->optOutSubscriber1($outbound->folderid, $this->device_address); $this->confirmOptOut3($this->device_address, $sms); } //$this->_keyword->deleteSubscriber($this->_sender); } }