mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-23 17:46:09 +02:00
Auto-detecting of mime type for emails and switched to HtmlFormatter for emails by default, fixes #577
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Formatter\FormatterInterface;
|
||||
use Monolog\Formatter\HtmlFormatter;
|
||||
|
||||
/**
|
||||
* Base class for all mail handlers
|
||||
*
|
||||
@@ -64,4 +67,19 @@ abstract class MailHandler extends AbstractProcessingHandler
|
||||
|
||||
return $highestRecord;
|
||||
}
|
||||
|
||||
protected function isHtmlBody($body)
|
||||
{
|
||||
return substr($body, 0, 1) === '<';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default formatter.
|
||||
*
|
||||
* @return FormatterInterface
|
||||
*/
|
||||
protected function getDefaultFormatter(): FormatterInterface
|
||||
{
|
||||
return new HtmlFormatter();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user