function ldap_user_mail in Lightweight Directory Access Protocol (LDAP) 8.3
Same name and namespace in other branches
- 8.4 ldap_user/ldap_user.module \ldap_user_mail()
- 8.2 ldap_user/ldap_user.module \ldap_user_mail()
- 7.2 ldap_user/ldap_user.module \ldap_user_mail()
Implements hook_mail().
File
- ldap_user/ldap_user.module, line 42 
- Module for the LDAP User Entity.
Code
function ldap_user_mail($key, &$message, $params) {
  switch ($key) {
    case 'orphaned_accounts':
      $message['subject'] = \Drupal::config('system.site')
        ->get('name') . ' ' . t('Orphaned LDAP Users');
      $message['body'][] = t('The following %count Drupal users no longer have corresponding LDAP entries. They probably have been removed from the directory and might need to be removed from your site.', [
        '%count' => count($params['accounts']),
      ]);
      $message['body'][] .= "\n" . t('Username,Mail,Link') . "\n" . implode("\n", $params['accounts']);
      break;
  }
}