make SMTP credentials extendable
This commit is contained in:
parent
0ac5d75b9a
commit
e06cc155dc
@ -26,7 +26,22 @@ use OxidEsales\Eshop\Core\Registry;
|
||||
class MailConfigCheck extends AdminDetailsController
|
||||
{
|
||||
protected $_sThisTemplate = '@'.Constants::OXID_MODULE_ID.'/admin/mailConfigCheck';
|
||||
protected string $testMailAddress = 'test@example.dev';
|
||||
protected string $testMailAddress = 'test@example.tld';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->setSmtpCredentials();
|
||||
}
|
||||
|
||||
protected function setSmtpCredentials(): void
|
||||
{
|
||||
$shop = Registry::getConfig()->getActiveShop();
|
||||
|
||||
$this->addTplParam('smtpHost', $shop->getFieldData('oxsmtp'));
|
||||
$this->addTplParam('smtpUser', $shop->getFieldData('oxsmtpuser'));
|
||||
}
|
||||
|
||||
public function render(): string
|
||||
{
|
||||
|
@ -64,9 +64,9 @@ class SmtpChecker extends AdminDetailsController
|
||||
['host' => $shopHost, 'port' => $shopPort] = parse_url(trim($activeShop->getFieldData('oxsmtp')));
|
||||
}
|
||||
|
||||
$this->host = $shopHost;
|
||||
$this->host = $shopHost ?? '';
|
||||
$this->addTplParam('smtpHost', Registry::getRequest()->getRequestEscapedParameter('smtpHost'));
|
||||
$this->port = $shopPort;
|
||||
$this->port = $shopPort ?? 587;
|
||||
$this->user = Registry::getRequest()->getRequestEscapedParameter('smtpUser') ?: $activeShop->getFieldData('oxsmtpuser');
|
||||
$this->addTplParam('smtpUser', $this->user);
|
||||
$this->pwd = Registry::getRequest()->getRequestEscapedParameter('smtpPwd') ?: $activeShop->getFieldData('oxsmtppwd');
|
||||
|
Loading…
Reference in New Issue
Block a user