| @@ 94-102 (lines=9) @@ | ||
| 91 | return true; |
|
| 92 | } |
|
| 93 | $shift = new \VolunteerShift(false, $entry[0]); |
|
| 94 | if($shift->isFilled()) |
|
| 95 | { |
|
| 96 | $email = new \Emails\ShiftEmail($shift, 'shiftCanceledSource'); |
|
| 97 | $emailProvider = \EmailProvider::getInstance(); |
|
| 98 | if($emailProvider->sendEmail($email) === false) |
|
| 99 | { |
|
| 100 | throw new \Exception('Unable to send email!'); |
|
| 101 | } |
|
| 102 | } |
|
| 103 | return true; |
|
| 104 | } |
|
| 105 | ||
| @@ 534-542 (lines=9) @@ | ||
| 531 | unset($entity['needEEApproval']); |
|
| 532 | } |
|
| 533 | $ret = $dataTable->update($filter, $entity); |
|
| 534 | if($ret) |
|
| 535 | { |
|
| 536 | $email = new \Emails\ShiftEmail($shift, 'shiftEmptiedSource'); |
|
| 537 | $emailProvider = \EmailProvider::getInstance(); |
|
| 538 | if($emailProvider->sendEmail($email) === false) |
|
| 539 | { |
|
| 540 | throw new \Exception('Unable to send email!'); |
|
| 541 | } |
|
| 542 | } |
|
| 543 | return $response->withJSON($ret); |
|
| 544 | } |
|
| 545 | ||