public function auth($apiKey, $secretKey) { $test = new Mailjet_ApiOverlay($apiKey, $secretKey); $result = $test->getUser(); if ($result !== false) { $this->account->API_KEY = $apiKey; $this->account->SECRET_KEY = $secretKey; $this->account->EMAIL = $result->Email; $this->account->AUTHENTICATION = 1; $this->updateAccountSettings(); Configuration::updateValue('PS_MAIL_SERVER', $this->mj_mail_server); Configuration::updateValue('PS_MAIL_SMTP_PORT', $this->mj_mail_port); //Configuration::updateValue('PS_MAIL_SMTP_ENCRYPTION', 'tls'); Configuration::updateValue('PS_MAIL_USER', $apiKey); Configuration::updateValue('PS_MAIL_PASSWD', $secretKey); Configuration::updateValue('PS_MAIL_METHOD', 2); $account = Tools::jsonDecode(Configuration::get('MAILJET'), true); Configuration::updateValue('PS_SHOP_EMAIL', $result->Email); self::setSMTPconnectionParams(); if ($this->account->MASTER_LIST_SYNCHRONIZED == 0) { return $this->initalSynchronize(); } return true; } else { $this->errors_list[] = $this->l('Please verify that you have entered your API and secret key correctly. Please note this plug-in is compatible for Mailjet v3 accounts only.') . '<a href="https://app.mailjet.com/support/why-do-i-get-an-api-error-when-trying-to-activate-a-mailjet-plug-in,497.htm" target="_blank" style="text-decoration:underline;">' . $this->l('Click here ') . '</a>' . $this->l(' to check the version of your Mailjet account'); } return false; }