|
|
@@ -2084,12 +2084,23 @@ class Email implements JsonSerializable, Serializable
|
|
|
}
|
|
|
Log::write(
|
|
|
$config['level'],
|
|
|
- PHP_EOL . $contents['headers'] . PHP_EOL . PHP_EOL . $contents['message'],
|
|
|
+ PHP_EOL . $this->flatten($contents['headers']) . PHP_EOL . PHP_EOL . $this->flatten($contents['message']),
|
|
|
$config['scope']
|
|
|
);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Converts given value to string
|
|
|
+ *
|
|
|
+ * @param string|array $value The value to convert
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ protected function flatten($value)
|
|
|
+ {
|
|
|
+ return is_array($value) ? implode(';', $value) : (string)$value;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Static method to fast create an instance of \Cake\Mailer\Email
|
|
|
*
|
|
|
* @param string|array|null $to Address to send (see Cake\Mailer\Email::to()). If null, will try to use 'to' from transport config
|