public function sendAction() { $params = \ZendJobQueue::getCurrentJobParams(); $issue = $this->issueResource->fetch($params['issueId']); unset($params['issueId']); $params['issue'] = $issue; return false; }
/** * The default action - show the home page */ public function emailAction() { $params = ZendJobQueue::getCurrentJobParams(); // TODO: throw exception when not called from a job, in the init method? if (!$this->_helper->requestValidation($params['password'])) { ZendJobQueue::setCurrentJobStatus(ZendJobQueue::FAILED); // TODO: not very nice, should be logged exit('Terminated, validation error!'); } $mail = new Zend_Mail(); $mail->setBodyText($params['body']); $mail->setFrom('*****@*****.**', 'SimpleCal Admin'); $mail->addTo($params['to']); $mail->setSubject($params['subject']); #$mail->send(); $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); }
public function indexAction() { $params = ZendJobQueue::getCurrentJobParams(); if (isset($params['obj'])) { $obj = unserialize(base64_decode($params['obj'])); if ($obj instanceof ZendServer_JobQueue_Job_Abstract) { try { $obj->run(); ZendJobQueue::setCurrentJobStatus(ZendJobQueue::OK); exit; } catch (Exception $e) { zend_monitor_set_aggregation_hint(get_class($obj) . ': ' . $e->getMessage()); zend_monitor_custom_event('Failed Job', $e->getMessage()); } } } ZendJobQueue::setCurrentJobStatus(ZendJobQueue::FAILED); exit; }