Skip to content
Permalink
Browse files

Logging email fails array to string conversion

Array to string conversion fails at class Email.php line 2087.
The _logDelivery function under Email.php is trying to convert an array to a string and it's failing as expected.
  • Loading branch information...
obinoob committed Sep 4, 2017
1 parent 3f9caaa commit aa5a01290d37a33833eefabc2e09c4aaa4ccd454
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/Mailer/Email.php
@@ -2060,7 +2060,8 @@ public function send($content = null)
return $contents;
}
/**
* Log the email message delivery.
*
@@ -2084,10 +2085,20 @@ protected function _logDelivery($contents)
}
Log::write(
$config['level'],
PHP_EOL . $contents['headers'] . PHP_EOL . PHP_EOL . $contents['message'],
PHP_EOL . $this->_isKeyArray($contents['headers']) . PHP_EOL . PHP_EOL . $this->_isKeyArray($contents['message']),
$config['scope']
);
}
/**
* @param null $key
* @return null|string
*/
private function _isKeyArray($key = null)
{
return is_array($key) ? implode(';', $key) : $key;
}
/**
* Static method to fast create an instance of \Cake\Mailer\Email

0 comments on commit aa5a012

Please sign in to comment.
You can’t perform that action at this time.