/**
  * Send a task to the interviewing manager, giving details of scheduled interview
  *
  * @param JobApplicationEvent $jobApplicationEvent Job Application Event object
  *
  * @return boolean True if mail sent, false otherwise
  */
 public function sendInterviewTaskToManager($jobApplicationEvent)
 {
     /* Get interview details */
     $intManagerId = $jobApplicationEvent->getOwner();
     if (empty($intManagerId)) {
         throw new RecruitmentMailNotifierException("Invalid parameters", RecruitmentMailNotifierException::INVALID_PARAMETER);
     }
     $intManagerEmail = $this->_getEmpAddress($intManagerId);
     if (empty($intManagerEmail)) {
         $this->_log("Interviewing manager {$intManagerId} does not have email address.");
         return false;
     }
     $intManagerName = $this->_getEmpName($intManagerId);
     $jobApplication = JobApplication::getJobApplication($jobApplicationEvent->getApplicationId());
     $applicantName = $jobApplication->getFirstName() . ' ' . $jobApplication->getLastName();
     $applicantEmail = $jobApplication->getEmail();
     $creatorName = $jobApplicationEvent->getCreatorName();
     $creatorEmail = $jobApplicationEvent->getCreatorEmail();
     $interviewTime = $jobApplicationEvent->getEventTime();
     $vacancy = JobVacancy::getJobVacancy($jobApplication->getVacancyId());
     /* Get summary and description from templates */
     $subject = $this->_getTemplate(self::SUBJECT_INTERVIEW_MANAGER_TASK);
     $body = $this->_getTemplate(self::TEMPLATE_INTERVIEW_MANAGER_TASK);
     // Replace placeholders in subject and body
     $search = array(self::VARIABLE_JOB_TITLE, self::VARIABLE_TO, self::VARIABLE_APPLICANT_FIRSTNAME, self::VARIABLE_APPLICANT_MIDDLENAME, self::VARIABLE_APPLICANT_LASTNAME, self::VARIABLE_APPLICANT_STREET1, self::VARIABLE_APPLICANT_STREET2, self::VARIABLE_APPLICANT_CITY, self::VARIABLE_APPLICANT_PROVINCE, self::VARIABLE_APPLICANT_ZIP, self::VARIABLE_APPLICANT_COUNTRY, self::VARIABLE_APPLICANT_PHONE, self::VARIABLE_APPLICANT_MOBILE, self::VARIABLE_APPLICANT_EMAIL, self::VARIABLE_APPLICANT_QUALIFICATIONS, self::VARIABLE_INTERVIEW_NOTES);
     $country = $this->_getCountryName($jobApplication->getCountry());
     $replace = array($vacancy->getJobTitleName(), $intManagerName['first'], $jobApplication->getFirstName(), $jobApplication->getMiddleName(), $jobApplication->getLastName(), $jobApplication->getStreet1(), $jobApplication->getStreet2(), $jobApplication->getCity(), $jobApplication->getProvince(), $jobApplication->getZip(), $country, $jobApplication->getPhone(), $jobApplication->getMobile(), $jobApplication->getEmail(), $jobApplication->getQualifications(), $jobApplicationEvent->getNotes());
     $summary = str_replace($search, $replace, $subject);
     $description = str_replace($search, $replace, $body);
     /* Create task */
     $message = $this->_getTask($summary, $description, $creatorName, $creatorEmail, $applicantName, $applicantEmail, $interviewTime);
     $mailer = $this->_getMailer();
     $attachment = $mailer->createAttachment($message);
     $attachment->type = 'text/calendar';
     $attachment->filename = 'interview.ics';
     /* Send Email with task attached */
     $to = "{$intManagerName['first']} {$intManagerName['last']}<{$intManagerEmail}>";
     $body = '';
     $notificationType = null;
     $attachments = array($attachment);
     $subject = $summary;
     $this->_sendMail($to, $subject, $body, $notificationType, $attachments);
 }