original_string: public function sendMessageNotification(Message $message, User $user)
      {
          $forum = $message->getSubject()->getCategory()->getForum();
          $notifications = $this->notificationRepo->findBy(array('forum' => $forum));
          $users = array();
  
          foreach ($notifications as $notification) {
              $users[] = $notification->getUser();
          }
  
          $title = $this->translator->trans(
              'forum_new_message',
              array('%forum%' => $forum->getResourceNode()->getName(), '%subject%' => $message->getSubject()->getTitle(), '%author%' => $message->getCreator()->getUsername()),
              'forum'
          );
  
          $url = $this->router->generate(
              'claro_forum_subjects', array('category' => $message->getSubject()->getCategory()->getId()), true
          );
  
          $body = "<a href='{$url}'>{$title}</a><hr>{$message->getContent()}";
  
          $this->mailManager->send($title, $body, $users);
      }
code: public function sendMessageNotification(Message $message, User $user)
      {
          $forum = $message->getSubject()->getCategory()->getForum();
          $notifications = $this->notificationRepo->findBy(array('forum' => $forum));
          $users = array();
  
          foreach ($notifications as $notification) {
              $users[] = $notification->getUser();
          }
  
          $title = $this->translator->trans(
              'forum_new_message',
              array('%forum%' => $forum->getResourceNode()->getName(), '%subject%' => $message->getSubject()->getTitle(), '%author%' => $message->getCreator()->getUsername()),
              'forum'
          );
  
          $url = $this->router->generate(
              'claro_forum_subjects', array('category' => $message->getSubject()->getCategory()->getId()), true
          );
  
          $body = "<a href='{$url}'>{$title}</a><hr>{$message->getContent()}";
  
          $this->mailManager->send($title, $body, $users);
      }
code_tokens: public function sendMessageNotification ( Message $ message , User $ user ) { $ forum = $ message -> getSubject ( ) -> getCategory ( ) -> getForum ( ) ; $ notifications = $ this -> notificationRepo -> findBy ( array ( 'forum' => $ forum ) ) ; $ users = array ( ) ; foreach ( $ notifications as $ notification ) { $ users [ ] = $ notification -> getUser ( ) ; } $ title = $ this -> translator -> trans ( 'forum_new_message' , array ( '%forum%' => $ forum -> getResourceNode ( ) -> getName ( ) , '%subject%' => $ message -> getSubject ( ) -> getTitle ( ) , '%author%' => $ message -> getCreator ( ) -> getUsername ( ) ) , 'forum' ) ; $ url = $ this -> router -> generate ( 'claro_forum_subjects' , array ( 'category' => $ message -> getSubject ( ) -> getCategory ( ) -> getId ( ) ) , true ) ; $ body = "<a href='{$url}'>{$title}</a><hr>{$message->getContent()}" ; $ this -> mailManager -> send ( $ title , $ body , $ users ) ; }
docstring: Send a notification to a user about a message.
  
  @param \Claroline\ForumBundle\Entity\Message $message
  @param \Claroline\CoreBundle\Entity\User $user
docstring_tokens: Send a notification to a user about a message .