diff --git a/src/Modules/Core/d3_dev_oxemail.php b/src/Modules/Core/d3_dev_oxemail.php index 258a665..b858ddc 100644 --- a/src/Modules/Core/d3_dev_oxemail.php +++ b/src/Modules/Core/d3_dev_oxemail.php @@ -1,10 +1,5 @@ getActiveShop()->isProductiveMode()) { return ''; @@ -154,6 +155,10 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent return $oSmarty->fetch($myConfig->getTemplatePath($sTpl, false)); } + /** + * @return bool + * @throws StandardException + */ protected function _sendMail() { if (Registry::getConfig()->getActiveShop()->isProductiveMode()) { @@ -161,6 +166,8 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent } $this->d3clearRecipients(); + $this->d3clearReplies(); + $this->d3clearReplyTo(); $this->d3clearCC(); $this->d3clearBCC(); @@ -190,6 +197,44 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent $this->_aRecipients = $aRecipients; } + public function d3clearReplies() + { + $aRecipients = array(); + if (is_array($this->_aReplies) && count($this->_aReplies)) { + foreach ($this->_aReplies as $aRecInfo) { + if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0])) + && $sNewRecipient != $aRecInfo[0] + ) { + $aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")"; + $aRecInfo[0] = $sNewRecipient; + $aRecipients[] = $aRecInfo; + } elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) { + $aRecipients[] = $aRecInfo; + } + } + } + $this->_aReplies = $aRecipients; + } + + public function d3clearReplyTo() + { + $aRecipients = array(); + if (is_array($this->ReplyTo) && count($this->ReplyTo)) { + foreach ($this->ReplyTo as $aRecInfo) { + if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0])) + && $sNewRecipient != $aRecInfo[0] + ) { + $aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")"; + $aRecInfo[0] = $sNewRecipient; + $aRecipients[] = $aRecInfo; + } elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) { + $aRecipients[] = $aRecInfo; + } + } + } + $this->ReplyTo = $aRecipients; + } + public function d3clearCC() { $aCc = array(); @@ -230,6 +275,11 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent $this->bcc = $aCc; } + /** + * @param $sMailAddress + * + * @return bool|string + */ public function getNewRecipient($sMailAddress) { if (Registry::getConfig()->getConfigParam('blD3DevBlockMails')) {