public function tableSend($action, $id)
 {
     $message = $this->repository->find($id);
     $x = $this->newsletterManager->sendNewsletter($message);
     $this->presenter->flashMessage('Newsletter byl odeslán na ' . $x . ' kontaktů.');
     $this->redirect('this');
 }
 /**
  * @inheritdoc
  */
 public function moveMessages($sourceFolder, $targetFolder)
 {
     $data = array('sourceFolder' => $sourceFolder, 'targetFolder' => $targetFolder);
     $config = array();
     ArrayUtil::apply($config, $this->getFolderHybridCheckConfiguration('targetFolder'));
     ArrayUtil::apply($config, $this->getFolderHybridCheckConfiguration('sourceFolder'));
     ArgumentCheck::check($config, $data);
     $sourceEntity = $this->makeFolderEntity($sourceFolder);
     $targetEntity = $this->makeFolderEntity($targetFolder);
     try {
         $this->messageRepository->moveMessagesFromFolder($sourceEntity, $targetEntity);
     } catch (\Exception $e) {
         throw new FolderServiceException("Exception thrown by previous exception", 0, $e);
     }
 }