show communication protocol from shop
# Conflicts: # views/twig/admin/mailConfigCheck.html.twig
Cette révision appartient à :
@ -33,6 +33,7 @@ class MailConfigCheck extends AdminDetailsController
|
||||
{
|
||||
$this->checkDataAreSet();
|
||||
$this->addTplParam('shop', Registry::getConfig()->getActiveShop());
|
||||
$this->addTplParam('recipient', $this->testMailAddress);
|
||||
|
||||
return parent::render();
|
||||
}
|
||||
@ -74,13 +75,31 @@ class MailConfigCheck extends AdminDetailsController
|
||||
{
|
||||
try {
|
||||
$shop = Registry::getConfig()->getActiveShop();
|
||||
$config = Registry::getConfig();
|
||||
|
||||
$mail = oxNew(Email::class);
|
||||
$mail->setRecipient($this->testMailAddress);
|
||||
$mail->setRecipient(
|
||||
trim(Registry::getRequest()->getRequestEscapedParameter('recipient')) ?: $this->testMailAddress
|
||||
);
|
||||
$mail->setBody('.');
|
||||
$mail->setFrom($shop->getFieldData('oxowneremail'));
|
||||
|
||||
$currentDebug = $config->getConfigParam('iDebug');
|
||||
$config->setConfigParam('iDebug', 6);
|
||||
$mail->setSmtp();
|
||||
|
||||
ob_start();
|
||||
$mail->send();
|
||||
$communication = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$re = '/(^|\<br\>)(\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s)/m';
|
||||
$subst = "$1";
|
||||
$communication = preg_replace($re, $subst, $communication);
|
||||
|
||||
$config->setConfigParam('iDebug', $currentDebug);
|
||||
$this->addTplParam('mailer', $mail->getMailer());
|
||||
$this->addTplParam('communication', $communication);
|
||||
} catch (Exception $e) {
|
||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||
}
|
||||
|
Référencer dans un nouveau ticket
Bloquer un utilisateur