1
0
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:
Jordi Boggiano
2016-05-26 22:41:26 +01:00
parent af7c0a7bda
commit 8a45ed75cc
7 changed files with 47 additions and 7 deletions

View File

@@ -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();
}
}