You are here

function login_security_mail in Login Security 8

Same name and namespace in other branches
  1. 6 login_security.module \login_security_mail()
  2. 7 login_security.module \login_security_mail()
  3. 2.x login_security.module \login_security_mail()

Implements hook_mail().

File

./login_security.module, line 455
Login Security module hooks.

Code

function login_security_mail($key, &$message, $variables) {
  $conf = \Drupal::config('login_security.settings');
  switch ($key) {
    case 'block_user_notify':
      $message['subject'] = SafeMarkup::format($conf
        ->get('user_blocked_email_subject'), $variables);
      $message['body'][] = SafeMarkup::format($conf
        ->get('user_blocked_email_body'), $variables);
      break;
    case 'login_activity_notify':
      $message['subject'] = SafeMarkup::format($conf
        ->get('login_activity_email_subject'), $variables);
      $message['body'][] = SafeMarkup::format($conf
        ->get('login_activity_email_body'), $variables);
      break;
  }
}