/** * Checks if a client ID was already set or not */ private function checkForClientID() { // fetch client ID $clientId = BackendMailmotorCMHelper::getClientID(); // no client ID set, so redirect to settings with an appropriate error message. if (empty($clientId)) { $this->redirect(BackendModel::createURLForAction('Settings', 'Mailmotor', BL::getWorkingLanguage())); } // get price per email $pricePerEmail = $this->get('fork.settings')->get('Mailmotor', 'price_per_email'); // check if a price per e-mail is set if (empty($pricePerEmail) && $pricePerEmail != 0) { $this->redirect(BackendModel::createURLForAction('Settings', 'Mailmotor', BL::getWorkingLanguage()) . '&error=no-price-per-email'); } }
/** * Get all necessary data */ private function getData() { // define mailmotor settings $this->settings = $this->get('fork.settings')->getForModule($this->getModule()); // check if an account was linked already and/or client ID was set $this->accountLinked = BackendMailmotorCMHelper::checkAccount(); $this->clientID = BackendMailmotorCMHelper::getClientID(); }