Merge pull request #8384 from garas/mailtransport-log-subject

Email log missing Subject and To headers when using MailTransport
This commit is contained in:
Mark Story 2016-03-02 21:29:13 -05:00
commit 18b0334890
3 changed files with 8 additions and 2 deletions

View file

@ -1184,7 +1184,7 @@ class CakeEmail {
}
CakeLog::write(
$config['level'],
PHP_EOL . $contents['headers'] . PHP_EOL . $contents['message'],
PHP_EOL . $contents['headers'] . PHP_EOL . PHP_EOL . $contents['message'],
$config['scope']
);
}

View file

@ -49,6 +49,9 @@ class MailTransport extends AbstractTransport {
$params = isset($this->_config['additionalParameters']) ? $this->_config['additionalParameters'] : null;
$this->_mail($to, $subject, $message, $headers, $params);
$headers .= $eol . 'Subject: ' . $subject;
$headers .= $eol . 'To: ' . $to;
return array('headers' => $headers, 'message' => $message);
}

View file

@ -84,7 +84,10 @@ class MailTransportTest extends CakeTestCase {
'-f'
);
$this->MailTransport->send($email);
$result = $this->MailTransport->send($email);
$this->assertContains('Subject: ', $result['headers']);
$this->assertContains('To: ', $result['headers']);
}
}