/** * @return Codendi_Mail */ public function buildEmail(Project $project, Notification $notification) { $mail = new Codendi_Mail(); $mail->setFrom(ForgeConfig::get('sys_noreply')); $mail->setBcc($this->getBcc($notification)); $mail->setTo(''); if ($project->getTruncatedEmailsUsage()) { $presenter = new MailPresenter($notification->getServiceName(), $notification->getGotoLink(), ForgeConfig::get('sys_fullname')); $mail->setSubject($this->renderer->renderToString(self::TRUNCATED_SUBJECT_TEMPLATE, $presenter)); $mail->setBodyHtml($this->renderer->renderToString(self::TRUNCATED_BODY_TEMPLATE, $presenter)); } else { if ($notification->hasHTMLBody()) { $mail->setBodyHtml($notification->getHTMLBody()); } if ($notification->hasTextBody()) { $mail->setBodyText($notification->getTextBody()); } $mail->setSubject($notification->getSubject()); } return $mail; }