Esempio n. 1
0
 /**
  * main method that runs reminding process
  * @return boolean
  */
 public function process()
 {
     $admin = new Administration();
     $admin->retrieveSettings();
     Reminder::sendEmailReminders($this, $admin);
     $meetings = $this->getMeetingsForRemind();
     foreach ($meetings as $id) {
         $recipients = $this->getRecipients($id, 'Meetings');
         $bean = new Meeting();
         $bean->retrieve($id);
         if ($this->sendReminders($bean, $admin, $recipients)) {
             $bean->email_reminder_sent = 1;
             $bean->save();
         }
     }
     $calls = $this->getCallsForRemind();
     foreach ($calls as $id) {
         $recipients = $this->getRecipients($id, 'Calls');
         $bean = new Call();
         $bean->retrieve($id);
         if ($this->sendReminders($bean, $admin, $recipients)) {
             $bean->email_reminder_sent = 1;
             $bean->save();
         }
     }
     return true;
 }