Fix required after optional warning in SMTP mailer

[MAILPOET-3296]
This commit is contained in:
Rostislav Wolny
2020-11-26 15:41:16 +01:00
committed by Veljko V
parent e2236e45df
commit 0f7f173259
3 changed files with 20 additions and 11 deletions

View File

@@ -98,13 +98,13 @@ class Mailer {
$this->mailerConfig['host'], $this->mailerConfig['host'],
$this->mailerConfig['port'], $this->mailerConfig['port'],
$this->mailerConfig['authentication'], $this->mailerConfig['authentication'],
$this->mailerConfig['login'],
$this->mailerConfig['password'],
$this->mailerConfig['encryption'], $this->mailerConfig['encryption'],
$this->sender, $this->sender,
$this->replyTo, $this->replyTo,
$this->returnPath, $this->returnPath,
new SMTPMapper() new SMTPMapper(),
$this->mailerConfig['login'],
$this->mailerConfig['password']
); );
break; break;
default: default:

View File

@@ -35,8 +35,17 @@ class SMTP {
private $wp; private $wp;
public function __construct( public function __construct(
$host, $port, $authentication, $login = null, $password = null, $encryption, $host,
$sender, $replyTo, $returnPath, SMTPMapper $errorMapper) { $port,
$authentication,
$encryption,
$sender,
$replyTo,
$returnPath,
SMTPMapper $errorMapper,
$login = null,
$password = null
) {
$this->wp = new WPFunctions; $this->wp = new WPFunctions;
$this->host = $host; $this->host = $host;
$this->port = $port; $this->port = $port;

View File

@@ -51,13 +51,13 @@ class SMTPTest extends \MailPoetTest {
$this->settings['host'], $this->settings['host'],
$this->settings['port'], $this->settings['port'],
$this->settings['authentication'], $this->settings['authentication'],
$this->settings['login'],
$this->settings['password'],
$this->settings['encryption'], $this->settings['encryption'],
$this->sender, $this->sender,
$this->replyTo, $this->replyTo,
$this->returnPath, $this->returnPath,
new SMTPMapper() new SMTPMapper(),
$this->settings['login'],
$this->settings['password']
); );
$this->subscriber = 'Recipient <mailpoet-phoenix-test@mailinator.com>'; $this->subscriber = 'Recipient <mailpoet-phoenix-test@mailinator.com>';
$this->newsletter = [ $this->newsletter = [
@@ -91,13 +91,13 @@ class SMTPTest extends \MailPoetTest {
$this->settings['host'], $this->settings['host'],
$this->settings['port'], $this->settings['port'],
$this->settings['authentication'], $this->settings['authentication'],
$this->settings['login'],
$this->settings['password'],
$this->settings['encryption'], $this->settings['encryption'],
$this->sender, $this->sender,
$this->replyTo, $this->replyTo,
$returnPath = false, $returnPath = false,
new SMTPMapper() new SMTPMapper(),
$this->settings['login'],
$this->settings['password']
); );
expect($mailer->returnPath)->equals($this->sender['from_email']); expect($mailer->returnPath)->equals($this->sender['from_email']);
} }