use modified info address from shop for connection test

prevent providers RFC 2606 notification
This commit is contained in:
Daniel Seifert 2024-09-20 11:59:28 +02:00
parent 586aa9e9c8
commit 8204a1ebd2

View File

@ -26,12 +26,22 @@ use OxidEsales\Eshop\Core\Registry;
class MailConfigCheck extends AdminDetailsController
{
protected $_sThisTemplate = '@'.Constants::OXID_MODULE_ID.'/admin/mailConfigCheck';
protected string $testMailAddress = 'test@example.tld';
protected string $testMailAddress;
public function __construct()
{
parent::__construct();
try {
$infoMail = Registry::getConfig()->getActiveShop()->getFieldData( 'oxinfoemail' );
Assert::that($infoMail)->email();
$re = '/.*(@.*$)/m';
$subst = "noreply$1";
$this->testMailAddress = preg_replace($re, $subst, $infoMail);
} catch (InvalidArgumentException) {
$this->testMailAddress = 'test@example.tld';
}
$this->setSmtpCredentials();
}