Esempio n. 1
0
 public function execute_now()
 {
     global $g_task_command_list;
     debug("Execute now task id " . $this->id);
     $this->update_status(TASK_STATUS_RUNNING);
     try {
         $this->check_command();
         if ($this->get_value("command") == "mail_advertisement") {
             list($event_id, $guest_mail, $advertisement_id) = explode(",", $this->get_value("parameters"));
             mail_advertise($event_id, $guest_mail, $advertisement_id);
         } else {
             debug("Task not understood.");
         }
         $this->update_status(TASK_STATUS_SUCCESS);
     } catch (Exception $e) {
         $this->update_status(TASK_STATUS_ERROR, $e->getMessage());
     }
 }
Esempio n. 2
0
 public function send_to_me()
 {
     debug("Action Send to me");
     $user = need_authentication();
     mail_advertise($_SESSION["event_id"], $user->email, $this->id);
 }