You are here

function content_moderation_notifications_mail in Content Moderation Notifications 8

Same name and namespace in other branches
  1. 8.3 content_moderation_notifications.module \content_moderation_notifications_mail()
  2. 8.2 content_moderation_notifications.module \content_moderation_notifications_mail()

Implements hook_mail().

File

./content_moderation_notifications.module, line 91

Code

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