| @@ 188-204 (lines=17) @@ | ||
| 185 | * |
|
| 186 | * @return void |
|
| 187 | */ |
|
| 188 | public function actionMail($id) |
|
| 189 | { |
|
| 190 | try { |
|
| 191 | $tutors = $this->getModel()->getTutor($id); |
|
| 192 | $recipients = $this->parseTutorEmail($tutors); |
|
| 193 | ||
| 194 | $this->getEmailer()->tutor($recipients, $tutors->guid, 'block'); |
|
| 195 | ||
| 196 | Debugger::log('Sending email to block tutor successfull, result: ' . json_encode($recipients) . ', ' . $tutors->guid, Debugger::INFO); |
|
| 197 | $this->flashMessage('Email lektorovi byl odeslán..', 'ok'); |
|
| 198 | } catch(Exception $e) { |
|
| 199 | Debugger::log('Sending email to block tutor failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 200 | $this->flashMessage('Email lektorovi nebyl odeslán, result: ' . $e->getMessage(), 'error'); |
|
| 201 | } |
|
| 202 | ||
| 203 | $this->redirect('Block:edit', $id); |
|
| 204 | } |
|
| 205 | ||
| 206 | /** |
|
| 207 | * Prepare data for editing |
|
| @@ 174-190 (lines=17) @@ | ||
| 171 | /** |
|
| 172 | * @return void |
|
| 173 | */ |
|
| 174 | public function actionMail($id) |
|
| 175 | { |
|
| 176 | try { |
|
| 177 | $tutors = $this->getModel()->getTutor($id); |
|
| 178 | $recipients = $this->parseTutorEmail($tutors); |
|
| 179 | ||
| 180 | $this->getEmailer()->tutor($recipients, $tutors->guid, 'program'); |
|
| 181 | ||
| 182 | Debugger::log('Sending email to program tutor successfull, result: ' . json_encode($recipients) . ', ' . $tutors->guid, Debugger::INFO); |
|
| 183 | $this->flashMessage('Email lektorovi byl odeslán..', 'ok'); |
|
| 184 | } catch(Exception $e) { |
|
| 185 | Debugger::log('Sending email to program tutor failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 186 | $this->flashMessage('Email lektorovi nebyl odeslán, result: ' . $e->getMessage(), 'error'); |
|
| 187 | } |
|
| 188 | ||
| 189 | $this->redirect('Program:edit', $id); |
|
| 190 | } |
|
| 191 | ||
| 192 | /** |
|
| 193 | * View public program |
|