Пример #1
0
 public function _postInsert(TA_Model_Observed_Interface $subject, $msg)
 {
     $conference = Zend_Registry::get('conference');
     $userModel = new Core_Model_User();
     $values['submit'] = $subject->toArray();
     $mailer = new TA_Controller_Action_Helper_SendEmail();
     $mailer->sendEmail(array('to_email' => $conference['email'], 'html' => true, 'subject' => 'CORE Observer: ' . __CLASS__, 'template' => 'submit/postinsert'), $values);
 }
Пример #2
0
 private function _informSubscribers(TA_Model_Observed_Interface $subject, $msg)
 {
     $conference = Zend_Registry::get('conference');
     $sessionModel = new Core_Model_Session();
     $subscriptions = $sessionModel->getSubscriptions(null, $subject->session_id);
     if (!empty($subscriptions)) {
         $mailer = new TA_Controller_Action_Helper_SendEmail();
         $mailer->sendEmail(array('to_email' => $subscriptions, 'html' => true, 'subject' => $conference['name'] . ': Session updated', 'template' => 'session/observer'), $subject->toArray());
     }
 }
Пример #3
0
 public function _postInsert(TA_Model_Observed_Interface $subject, $msg)
 {
     $conference = Zend_Registry::get('conference');
     $userModel = new Core_Model_User();
     $user = $userModel->getUserById($subject->user_id);
     $submitModel = new Core_Model_Submit();
     $submission = $submitModel->getSubmissionById($subject->submission_id);
     $viewParams = $submission->toArray();
     $viewParams['fname'] = $user->fname;
     $viewParams['lname'] = $user->lname;
     $mailer = new TA_Controller_Action_Helper_SendEmail();
     $mailer->sendEmail(array('to_email' => $user->email, 'subject' => 'CORE Observer: ' . __CLASS__, 'template' => 'review/observer'), $viewParams);
 }
Пример #4
0
 private function _informSubscribers(TA_Model_Observed_Interface $subject, $msg)
 {
     $conference = Zend_Registry::get('conference');
     $sessionModel = new Core_Model_Session();
     $subscriptions = $sessionModel->getSubscriptions(null, $subject->session_id);
     $flash = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger');
     $subs = array();
     foreach ($subscriptions as $sub) {
         $subs[] = $sub['email'];
     }
     if (!empty($subscriptions)) {
         $mailer = new TA_Controller_Action_Helper_SendEmail();
         $mailer->sendEmail(array('to_email' => $conference['email'], 'html' => true, 'bcc' => $subs, 'subject' => $conference['name'] . ': Session updated', 'template' => 'session/subscriber'), $subject->toArray());
         $flash->addMessage('Successfully emailed ' . count($subs) . ' subscriber(s)');
     }
 }
Пример #5
0
 /**
  * Send email to tiebreakers
  *
  */
 private function _mailTiebreakers($subject)
 {
     $config = Zend_Registry::get('config');
     if ($config->core->observer->tiebreaker->notify == 1) {
         $submitModel = new Core_Model_Submit();
         $submission = $submitModel->getSubmissionById($subject->submission_id);
         $users = $submission->getUsers(true);
         $viewParams = $submission->toArray();
         $mailer = new TA_Controller_Action_Helper_SendEmail();
         foreach ($users as $user) {
             $viewParams['fname'] = $user->fname;
             $viewParams['lname'] = $user->lname;
             $mailer->sendEmail(array('to_email' => $user->email, 'subject' => 'CORE Review needed', 'template' => 'review/tiebreaker'), $viewParams);
         }
     }
 }