mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-01 19:00:20 +02:00
Merge branch '1.x'
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Formatter\FormatterInterface;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Swift_Message;
|
||||
use Swift;
|
||||
@@ -48,6 +49,17 @@ class SwiftMailerHandler extends MailHandler
|
||||
$this->mailer->send($this->buildMessage($content, $records));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the formatter for the Swift_Message subject.
|
||||
*
|
||||
* @param string $format The format of the subject
|
||||
* @return FormatterInterface
|
||||
*/
|
||||
protected function getSubjectFormatter($format)
|
||||
{
|
||||
return new LineFormatter($format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates instance of Swift_Message to be sent
|
||||
*
|
||||
@@ -70,7 +82,7 @@ class SwiftMailerHandler extends MailHandler
|
||||
}
|
||||
|
||||
if ($records) {
|
||||
$subjectFormatter = new LineFormatter($message->getSubject());
|
||||
$subjectFormatter = $this->getSubjectFormatter($message->getSubject());
|
||||
$message->setSubject($subjectFormatter->format($this->getHighestRecord($records)));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user