Ejemplo n.º 1
0
 /**
  * @param array $formData
  * @param array $settings
  *
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 protected function executePost(array $formData, array $settings)
 {
     return $this->actionHelper->handlePostAction(function () use($formData, $settings) {
         $this->adminFormValidation->validate($formData);
         $formData['user_id'] = $this->user->getUserId();
         $newsletterId = $this->newsletterModel->save($formData);
         list($text, $result) = $this->sendTestNewsletter($formData['test'] == 1, $newsletterId, $newsletterId, $settings['mail']);
         return $this->redirectMessages()->setMessage($result, $text);
     });
 }
Ejemplo n.º 2
0
 /**
  * @param string $action
  *
  * @return mixed
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($action = '')
 {
     return $this->actionHelper->handleDeleteAction($action, function (array $items) {
         return $this->newsletterModel->delete($items);
     });
 }