/** * Send Reviwer approve email * PerformanceReview $performanceReview * @return boolean */ public function sendReviwApproveEmail(PerformanceReview $performanceReview) { try { $email = $performanceReview->getReviewer()->getEmpWorkEmail(); if ($email != '') { $content = file_get_contents(sfConfig::get('sf_root_dir') . "/apps/orangehrm/templates/mail/" . self::EMAIL_TEMPLATE_HRADMIN_APPROVE); $varibles = array('#comments' => $performanceReview->getLatestComment(), '#employee' => $performanceReview->getEmployee()->getFirstName() . ' ' . $performanceReview->getEmployee()->getLastName()); $mailBody = strtr($content, $varibles); $mailService = new EmailService(); $mailService->setMessageTo(array($email)); $mailService->setMessageSubject("Performance Review Approved"); $mailService->setMessageBody($mailBody); @$mailService->sendEmail(); } return true; } catch (Exception $e) { throw new AdminServiceException($e->getMessage()); } }