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