Exemple #1
0
 /**
  * @param SJB_GuestAlert $guestAlert
  * @param SJB_TemplateProcessor $tp
  */
 public function saveNewGuestAlert(SJB_GuestAlert $guestAlert, SJB_TemplateProcessor $tp)
 {
     $guestAlert->addDataProperty(serialize($this->criteriaData));
     $guestAlert->addListingTypeIDProperty($this->listingTypeID);
     $guestAlert->save();
     $listingTypeSID = SJB_ListingTypeManager::getListingTypeSIDByID($this->listingTypeID);
     SJB_GuestAlertStatistics::saveEventSubscribed($listingTypeSID, $guestAlert->getSID());
     SJB_Notifications::sendConfirmationEmailForGuest($guestAlert);
     $tp->assign('email', $guestAlert->getAlertEmail());
     $this->template = 'alert_created.tpl';
 }
Exemple #2
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');
 }