| @@ 262-272 (lines=11) @@ | ||
| 259 | } |
|
| 260 | unset($user['certs'][$certType]); |
|
| 261 | $ret = $dataTable->update($filter, $user); |
|
| 262 | if($ret) |
|
| 263 | { |
|
| 264 | $profile = new \VolunteerProfile(false, $user); |
|
| 265 | $email = new \Emails\CertificationEmail($profile, 'certifcationRejected', $certType, array('reason'=>$reason)); |
|
| 266 | $emailProvider = \EmailProvider::getInstance(); |
|
| 267 | if($emailProvider->sendEmail($email) === false) |
|
| 268 | { |
|
| 269 | throw new \Exception('Unable to send email!'); |
|
| 270 | } |
|
| 271 | return $response->withStatus(200); |
|
| 272 | } |
|
| 273 | return $response->withStatus(500); |
|
| 274 | } |
|
| 275 | ||
| @@ 304-314 (lines=11) @@ | ||
| 301 | } |
|
| 302 | $user['certs'][$certType]['status'] = 'current'; |
|
| 303 | $ret = $dataTable->update($filter, $user); |
|
| 304 | if($ret) |
|
| 305 | { |
|
| 306 | $profile = new \VolunteerProfile(false, $user); |
|
| 307 | $email = new \Emails\CertificationEmail($profile, 'certifcationAccepted', $certType); |
|
| 308 | $emailProvider = \EmailProvider::getInstance(); |
|
| 309 | if($emailProvider->sendEmail($email) === false) |
|
| 310 | { |
|
| 311 | throw new \Exception('Unable to send email!'); |
|
| 312 | } |
|
| 313 | return $response->withStatus(200); |
|
| 314 | } |
|
| 315 | return $response->withStatus(500); |
|
| 316 | } |
|
| 317 | } |
|