You are here

function devel_mail_logger_mail in Devel Mail Logger 8

Same name and namespace in other branches
  1. 7 devel_mail_logger.module \devel_mail_logger_mail()

Implements hook_mail().

File

./devel_mail_logger.module, line 39
Contains devel_mail_logger.module.

Code

function devel_mail_logger_mail($key, &$message, $params) {
  $options = [
    'langcode' => $message['langcode'],
  ];
  switch ($key) {
    case 'send_test':
      $message['from'] = \Drupal::config('system.site')
        ->get('mail');
      $message['subject'] = t('Your mail subject Here: @subject', [
        '@subject' => $params['subject'],
      ], $options);
      $message['body'][] = Html::escape($params['message']);
      break;
  }
}