Beispiel #1
0
 public function execute()
 {
     $guestAlert = new SJB_GuestAlert($_REQUEST);
     $guestAlert->addDataProperty(serialize($this->criteriaData));
     $tp = SJB_System::getTemplateProcessor();
     try {
         $guestAlertSID = SJB_GuestAlertManager::getGuestAlertSIDByEmail($guestAlert->getAlertEmail());
         $guestAlert->setSID($guestAlertSID);
         $guestAlert->update();
     } catch (Exception $e) {
         $tp->assign('error', $e->getMessage());
     }
     $tp->display('alert_replaced.tpl');
 }
Beispiel #2
0
 /**
  * @param SJB_GuestAlert $guestAlert
  * @throws Exception
  */
 public function activate(SJB_GuestAlert $guestAlert)
 {
     if ($guestAlert->getPropertyValue('status') === SJB_GuestAlert::STATUS_UNSUBSCRIBED) {
         throw new Exception('Unsubscribed Guest Alert can not be activated');
     }
     $guestAlert->setStatusActive();
     $guestAlert->update();
 }