86400, 'Products' => 86400 ); public function notifyEmail( $subject, $message ) { $mail = new Zend_Mail(); $emails = explode(",", Mage::getStoreConfig('wexo_integrations_settings/general/notification_emails') ); //foreach ( $this->_notificationEmails as $email ) $mail->addTo($email, ''); foreach ( $emails as $email ) $mail->addTo($email, ''); $mail->setSubject($subject); $mail->setBodyHtml($message); $mail->send(); } public function genStamp( $entityType ) { file_put_contents ( Mage::getBaseDir() . "/var/" . $entityType, "" ); } public function dataReceived ( $observer ) { $dataType = $observer->getDatatype(); $this->genStamp($dataType); } public function checkStamps ( $observer ) { foreach ( $this->_checkModificationForDataEntities as $dataEntity => $interval ) { $mtime = filemtime ( Mage::getBaseDir() . "/var/" . $dataEntity ); $time = time(); if ( ($time - $mtime) > $interval ) { // fire a notification - there were no events $this->notifyEmail ( "Exception occured", "Did not receive $dataEntity for " . $interval . " seconds." ); } } } public function processException ( $observer ) { $exception = $observer->getException(); $itemtype = $observer->getItemtype(); $this->notifyEmail ( "Exception occured for $itemtype", "Exception message:" . $exception->getMessage() . ", exception trace: " . $exception->getTraceAsString() ); } }