Skip to content

Commit

Permalink
Include Subject and To in email log when using MailTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
garas committed Oct 16, 2017
1 parent eb609af commit 5de2418
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Mailer/Transport/MailTransport.php
Expand Up @@ -53,6 +53,9 @@ public function send(Email $email)
$params = isset($this->_config['additionalParameters']) ? $this->_config['additionalParameters'] : null;
$this->_mail($to, $subject, $message, $headers, $params);

$headers .= $eol . 'To: ' . $to;
$headers .= $eol . 'Subject: ' . $subject;

return ['headers' => $headers, 'message' => $message];
}

Expand Down
5 changes: 4 additions & 1 deletion tests/TestCase/Mailer/Transport/MailTransportTest.php
Expand Up @@ -89,6 +89,9 @@ public function testSendData()
'-f'
);

$this->MailTransport->send($email);
$result = $this->MailTransport->send($email);

$this->assertContains('Subject: ', $result['headers']);
$this->assertContains('To: ', $result['headers']);
}
}

0 comments on commit 5de2418

Please sign in to comment.