Skip to content

[bugfix] same SMTP configs usage for different stores #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Mail/Rse/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Mail
protected $_returnPath = [];

/**
* @var Zend_Mail_Transport_Smtp
* @var array
*/
protected $_transport;

Expand Down Expand Up @@ -127,7 +127,7 @@ public function setSmtpOptions($storeId, $options = [])
*/
public function getTransport($storeId)
{
if ($this->_transport === null) {
if (empty($this->_transport[$storeId])) {
if (!isset($this->_smtpOptions[$storeId])) {
$configData = $this->smtpHelper->getSmtpConfig('', $storeId);
$options = [
Expand Down Expand Up @@ -172,16 +172,16 @@ public function getTransport($storeId)

$options = new SmtpOptions($options);

$this->_transport = new Smtp($options);
$this->_transport[$storeId] = new Smtp($options);
} else {
$this->_transport = new Zend_Mail_Transport_Smtp(
$this->_transport[$storeId] = new Zend_Mail_Transport_Smtp(
$this->_smtpOptions[$storeId]['host'],
$this->_smtpOptions[$storeId]
);
}
}

return $this->_transport;
return $this->_transport[$storeId];
}

/**
Expand Down