Skip to content

Commit

Permalink
MailExtension: renamed option 'secure' -> 'encryption'
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 18, 2023
1 parent fb500d0 commit 23380ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Bridges/MailDI/MailExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function getConfigSchema(): Nette\Schema\Schema
'port' => Expect::int()->dynamic(),
'username' => Expect::string()->dynamic(),
'password' => Expect::string()->dynamic(),
'secure' => Expect::anyOf(null, 'ssl', 'tls')->dynamic(),
'secure' => Expect::anyOf(null, 'ssl', 'tls')->dynamic(), // deprecated
'encryption' => Expect::anyOf(null, 'ssl', 'tls')->dynamic(),
'timeout' => Expect::int()->dynamic(),
'context' => Expect::arrayOf('array')->dynamic(),
'clientHost' => Expect::string()->dynamic(),
Expand All @@ -38,7 +39,6 @@ public function getConfigSchema(): Nette\Schema\Schema
'selector' => Expect::string()->dynamic(),
'privateKey' => Expect::string()->required(),
'passPhrase' => Expect::string()->dynamic(),
'testMode' => Expect::bool(false)->dynamic(),
])->castTo('array')
),
])->castTo('array');
Expand All @@ -65,6 +65,7 @@ public function loadConfiguration()
}

if ($this->config['smtp']) {
$this->config['secure'] = $this->config['encryption'] ?? $this->config['secure'];
$mailer->setFactory(Nette\Mail\SmtpMailer::class, [$this->config]);
} else {
$mailer->setFactory(Nette\Mail\SendmailMailer::class);
Expand Down

0 comments on commit 23380ff

Please sign in to comment.