private function sendErrorMail($to, $subject, $message) { $mail = new Codendi_Mail(); $mail->setFrom(ForgeConfig::get('sys_noreply')); $mail->setTo($to); $mail->setSubject($subject); $mail->setBody($message); $mail->send(); }
public function sendMail(PFUser $user, Project $project, $tv3_id, $tracker_name) { $mail = new Codendi_Mail(); $breadcrumbs = array(); $breadcrumbs[] = '<a href="' . get_server_url() . '/projects/' . $project->getUnixName(true) . '" />' . $project->getPublicName() . '</a>'; $mail->getLookAndFeelTemplate()->set('breadcrumbs', $breadcrumbs); $mail->addAdditionalHeader("X-Codendi-Project", $project->getUnixName()); $mail->setFrom($GLOBALS['sys_noreply']); $mail->setTo($user->getEmail()); $mail->setSubject('Output of your migration TV3 -> TV5'); $mail->setBody($this->getMailBody($tv3_id, $tracker_name)); $mail->send(); $this->purgeLogStack(); }
/** * Prepare the mail to be sent after daily user sync * * @param String $recipients List of project administrators emails we want to notify * @param Integer $projectName Public name of the project we want to notify its administrators * @param String $subject The subject of the notification mail * @param String $body The content of the notification mail * * @return Codendi_Mail */ protected function prepareMail($recipients, $projectName, $subject, $body) { $mail = new Codendi_Mail(); $mail->setFrom($GLOBALS['sys_noreply']); if (empty($recipients)) { throw new InvalidArgumentException('Cannot send notification without any valid receiver, Perhaps the project <' . $projectName . '> has no administrators.'); } $mail->setSubject($subject); $mail->setTo($recipients); $mail->setBody($body); return $mail; }