mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #8384 from garas/mailtransport-log-subject
Email log missing Subject and To headers when using MailTransport
This commit is contained in:
commit
18b0334890
3 changed files with 8 additions and 2 deletions
|
@ -1184,7 +1184,7 @@ class CakeEmail {
|
||||||
}
|
}
|
||||||
CakeLog::write(
|
CakeLog::write(
|
||||||
$config['level'],
|
$config['level'],
|
||||||
PHP_EOL . $contents['headers'] . PHP_EOL . $contents['message'],
|
PHP_EOL . $contents['headers'] . PHP_EOL . PHP_EOL . $contents['message'],
|
||||||
$config['scope']
|
$config['scope']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,9 @@ class MailTransport extends AbstractTransport {
|
||||||
|
|
||||||
$params = isset($this->_config['additionalParameters']) ? $this->_config['additionalParameters'] : null;
|
$params = isset($this->_config['additionalParameters']) ? $this->_config['additionalParameters'] : null;
|
||||||
$this->_mail($to, $subject, $message, $headers, $params);
|
$this->_mail($to, $subject, $message, $headers, $params);
|
||||||
|
|
||||||
|
$headers .= $eol . 'Subject: ' . $subject;
|
||||||
|
$headers .= $eol . 'To: ' . $to;
|
||||||
return array('headers' => $headers, 'message' => $message);
|
return array('headers' => $headers, 'message' => $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,10 @@ class MailTransportTest extends CakeTestCase {
|
||||||
'-f'
|
'-f'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->MailTransport->send($email);
|
$result = $this->MailTransport->send($email);
|
||||||
|
|
||||||
|
$this->assertContains('Subject: ', $result['headers']);
|
||||||
|
$this->assertContains('To: ', $result['headers']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue