mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
refactor: get upper first protocol only one call in Email
This commit is contained in:
parent
f4213aba00
commit
d2bf2099e2
@ -1689,8 +1689,9 @@ class Email
|
|||||||
protected function spoolEmail()
|
protected function spoolEmail()
|
||||||
{
|
{
|
||||||
$this->unwrapSpecials();
|
$this->unwrapSpecials();
|
||||||
$protocol = $this->getProtocol();
|
$protocol = $this->getProtocol();
|
||||||
$method = 'sendWith' . ucfirst($protocol);
|
$upperFirstProtocol = ucfirst($protocol);
|
||||||
|
$method = 'sendWith' . $upperFirstProtocol;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$success = $this->{$method}();
|
$success = $this->{$method}();
|
||||||
@ -1700,7 +1701,7 @@ class Email
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! $success) {
|
if (! $success) {
|
||||||
$message = lang('Email.sendFailure' . ($protocol === 'mail' ? 'PHPMail' : ucfirst($protocol)));
|
$message = lang('Email.sendFailure' . ($protocol === 'mail' ? 'PHPMail' : $upperFirstProtocol));
|
||||||
|
|
||||||
log_message('error', 'Email: ' . $message);
|
log_message('error', 'Email: ' . $message);
|
||||||
log_message('error', $this->printDebuggerRaw());
|
log_message('error', $this->printDebuggerRaw());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user