freshmailSettings = (new FreshmailSettings())->findForShop($this->context->shop->id); if (!Validate::isLoadedObject(($this->freshmailSettings)) || 0 == $this->freshmailSettings->wizard_completed) { $link = $this->context->link->getAdminLink('AdminModules', true, [], ['configure' => $this->module->name]); Tools::redirectAdmin($link); } if(!empty($this->freshmailSettings->api_token)) { $this->freshmail = new \FreshMail\Freshmail($this->freshmailSettings->api_token); $response = $this->freshmail->check(); if (!$response['status']) { $link = $this->context->link->getAdminLink('AdminFreshmailConfig', true, [], ['configure' => $this->module->name]); Tools::redirectAdmin($link); } } return parent::init(); // TODO: Change the autogenerated stub } }