Skip to content

Commit 57a8859

Browse files
authored
Merge pull request #9449 from ddevsr/patch-3
refactor: get upper first protocol only one call in Email
2 parents f4213ab + d2bf209 commit 57a8859

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

system/Email/Email.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,8 +1689,9 @@ protected function removeNLCallback($matches)
16891689
protected function spoolEmail()
16901690
{
16911691
$this->unwrapSpecials();
1692-
$protocol = $this->getProtocol();
1693-
$method = 'sendWith' . ucfirst($protocol);
1692+
$protocol = $this->getProtocol();
1693+
$upperFirstProtocol = ucfirst($protocol);
1694+
$method = 'sendWith' . $upperFirstProtocol;
16941695

16951696
try {
16961697
$success = $this->{$method}();
@@ -1700,7 +1701,7 @@ protected function spoolEmail()
17001701
}
17011702

17021703
if (! $success) {
1703-
$message = lang('Email.sendFailure' . ($protocol === 'mail' ? 'PHPMail' : ucfirst($protocol)));
1704+
$message = lang('Email.sendFailure' . ($protocol === 'mail' ? 'PHPMail' : $upperFirstProtocol));
17041705

17051706
log_message('error', 'Email: ' . $message);
17061707
log_message('error', $this->printDebuggerRaw());

0 commit comments

Comments
 (0)