protected function DrupalMailHandler::send in Monolog 8
Same name and namespace in other branches
- 2.x src/Logger/Handler/DrupalMailHandler.php \Drupal\monolog\Logger\Handler\DrupalMailHandler::send()
File
- src/Logger/ Handler/ DrupalMailHandler.php, line 31 
Class
- DrupalMailHandler
- Class DrupalMailHandler.
Namespace
Drupal\monolog\Logger\HandlerCode
protected function send($content, array $records) {
  /** @var \Drupal\Core\Mail\MailManagerInterface $mail */
  $mail = \Drupal::service('plugin.manager.mail');
  /** @var \Drupal\Core\Language\LanguageInterface $default_language */
  $default_language = \Drupal::languageManager()
    ->getDefaultLanguage();
  $params = [
    'content' => $content,
    'records' => $records,
  ];
  $mail
    ->mail('monolog', 'default', $this->to, $default_language
    ->getName(), $params);
}