Original Submission Add the project and tracker name to the email subject for truncated emails. Also added the project name in the regular tracker email.
Patched in /usr/share/tuleap/src/common/mail/MailBuilder.php arounf line 56
private function buildEmail(Project $project, Notification $notification, MailEnhancer $mail_enhancer, $email) {
$mail = $this->getMailSender();
$mail->setFrom(ForgeConfig::get('sys_noreply'));
$mail->setTo($email);
if ($project->getTruncatedEmailsUsage()) {
$presenter = new MailPresenter(
$notification->getServiceName(),
$notification->getGotoLink(),
ForgeConfig::get('sys_fullname')
);
/* Replace this with the following with the 2 lines after . The mail_enhacer adds the token information for replies
$mail->setSubject($this->renderer->renderToString(self::TRUNCATED_SUBJECT_TEMPLATE, $presenter));
*/
$mail_enhancer->enhanceMail($mail); /* allows for replying to the tracker when active */
$mail->setSubject($project->getPublicName() . ' - ' .$notification->getSubject()); /* Add the project and tracker name to the subject */
$mail->setBodyHtml($this->renderer->renderToString(self::TRUNCATED_BODY_TEMPLATE, $presenter));
} else {
$mail_enhancer->enhanceMail($mail);
if ($notification->hasHTMLBody()) {
$mail->setBodyHtml($notification->getHTMLBody());
}
if ($notification->hasTextBody()) {
$mail->setBodyText($notification->getTextBody());
}
/* Replaced with the following line to add the project name
$mail->setSubject($notification->getSubject());
*/
$mail->setSubject($project->getPublicName() . ' - ' .$notification->getSubject());
}
return $mail;
}