/**
  * Sends email for comment approval
  *
  * @param \Lelesys\Plugin\News\Domain\Model\Comment $comment Comment for approval
  * @param \Lelesys\Plugin\News\Domain\Model\News $news The news
  * @return void
  */
 public function sendCommentApprovalNotification(\Lelesys\Plugin\News\Domain\Model\Comment $comment, \Lelesys\Plugin\News\Domain\Model\News $news)
 {
     $this->standaloneView->setTemplatePathAndFilename(FLOW_PATH_PACKAGES . $this->settings['notifications']['emailTemplatePath']);
     $this->standaloneView->assign('comment', $comment);
     $this->standaloneView->assign('adminEmail', $news->getCreatedBy());
     $this->standaloneView->assign('news', $news);
     $emailBody = $this->standaloneView->render();
     $toEmail = $news->getCreatedBy()->getPrimaryElectronicAddress()->getIdentifier();
     $mail = new \TYPO3\SwiftMailer\Message();
     $mail->setFrom(array($this->settings['notifications']['senderAddress'] => $this->settings['notifications']['senderName']))->setContentType('text/html')->setTo($toEmail)->setSubject('Comment Approval')->setBody($emailBody)->send();
 }
Exemplo n.º 2
0
 /**
  * shows's the hidden news
  *
  * @param \Lelesys\Plugin\News\Domain\Model\News $news News to display
  * @return void
  */
 public function showNews(\Lelesys\Plugin\News\Domain\Model\News $news)
 {
     $news->setHidden(0);
     $this->newsRepository->update($news);
     $this->emitNewsUpdated($news);
 }