/**
* Send email to author and all people from comments when vote is Approved or Rejected
*
* @param Post $post
* @param string $translation
* @param string $template
*/
private function sendPostVoteClosedEmail(Post $post, $translation, $template)
{
$recipients[] = $post->getAuthor()->getEmail();
/** @var Comment $comment */
$comments = $post->getComments();
foreach ($comments as $comment) {
$recipients[] = $comment->getUser()->getEmail();
}
$subject = $this->translator->trans($translation);
$body = $this->renderView($template, array('post' => $post));
$this->mailer->send($recipients, $subject, $body);
}