*/ class MailjetConfigController extends BaseAdminController { public function saveAction() { $baseForm = new MailjetConfigurationForm($this->getRequest()); try { $form = $this->validateForm($baseForm); $data = $form->getData(); ConfigQuery::write(Mailjet::CONFIG_API_KEY, $data["api_key"]); ConfigQuery::write(Mailjet::CONFIG_API_SECRET, $data["api_secret"]); ConfigQuery::write(Mailjet::CONFIG_API_WS_ADDRESS, $data["ws_address"]); ConfigQuery::write(Mailjet::CONFIG_NEWSLETTER_LIST, $data["newsletter_list"]); ConfigQuery::write(Mailjet::CONFIG_THROW_EXCEPTION_ON_ERROR, $data["exception_on_errors"] ? true : false); $this->getParserContext()->set("success", true); if ("close" === $this->getRequest()->request->get("save_mode")) { return new RedirectResponse(URL::getInstance()->absoluteUrl("/admin/modules")); } } catch (\Exception $e) { $this->getParserContext() ->setGeneralError($e->getMessage()) ->addForm($baseForm) ; } return $this->render('module-configure', [ 'module_code' => 'Mailjet' ]); } }