You are here

function simple_ldap_mail in Simple LDAP 7.2

Implements hook_mail()

Send a notification to a list of users when the LDAP server goes down.

File

./simple_ldap.module, line 104
Main simple_ldap module file.

Code

function simple_ldap_mail($key, &$message, $params) {
  if ($key === 'ldap_down') {
    $tokens = array(
      '@website' => $_SERVER['SERVER_NAME'],
    );
    $message['body'][] = t('The site @website cannot connect to any LDAP servers.', $tokens);
    $message['subject'] = t('LDAP DOWN ON @website', $tokens);
  }
}