protected function getMessageLink($type, $params)
 {
     if ($this->project->getTruncatedEmailsUsage()) {
         return $this->_url . '&action=details&id=' . $params['item']->getId() . '&section=history';
     }
     switch ($type) {
         case self::MESSAGE_MODIFIED:
         case self::MESSAGE_NEWVERSION:
             $link = $this->_url . '&action=details&id=' . $params['item']->getId();
             break;
         case self::MESSAGE_WIKI_NEWVERSION:
             $link = $params['url'];
             break;
         default:
             $link = $this->_url;
             break;
     }
     return $link;
 }
Example #2
0
 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'));
         $mail->setSubject($this->renderer->renderToString(self::TRUNCATED_SUBJECT_TEMPLATE, $presenter));
         $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());
         }
         $mail->setSubject($notification->getSubject());
     }
     return $mail;
 }
Example #3
0
 /**
  * @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;
 }
Example #4
0
 private function informUntruncatedEmailWillBeSent(Project $project)
 {
     if ($project->getTruncatedEmailsUsage()) {
         $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_tracker_include_type', 'untruncated_migration_email'));
     }
 }
 public function project_uses_truncated_emails()
 {
     return (bool) $this->project->getTruncatedEmailsUsage();
 }