You are here

function purge_users_send_notification in Auto Purge Users 7.2

Same name and namespace in other branches
  1. 7 purge_users.module \purge_users_send_notification()

Send notification email.

Parameters

mixed $account: User object.

2 calls to purge_users_send_notification()
purge_users_batch_process in ./purge_users.module
The batch processor.
purge_users_worker in ./purge_users.module
Cron queue worker callback function.

File

./purge_users.module, line 102
Purge users module file.

Code

function purge_users_send_notification($account) {
  $message = variable_get('purge_users_inactive_user_notify_text', '');

  // Call token replace on the text args into the second parameter.
  $message = token_replace($message, array(
    'user' => $account,
  ));
  $params = array(
    'subject' => t('Your account is deleted.'),
    'body' => check_markup($message, 'plain_text'),
  );
  $from = variable_get('site_mail', '');

  // Send the notification email.
  drupal_mail('purge_users', 'delete_users', $account->mail, user_preferred_language($account), $params, $from, TRUE);
}