You are here

function notify_user_insert in Notify 7

Same name and namespace in other branches
  1. 8 notify.module \notify_user_insert()
  2. 2.0.x notify.module \notify_user_insert()
  3. 1.0.x notify.module \notify_user_insert()

Implements hook_user_insert().

The notify_decision comes from the registration form, unless the user is imported, when there is no data from the form.

File

./notify.module, line 104
Notify module sends e-mail digests of new content and comments.

Code

function notify_user_insert(&$edit, $account, $category) {
  if (isset($edit['notify_decision']) && $edit['notify_decision'] == 1 || !isset($edit['notify_decision']) && variable_get('notify_import', 0)) {
    db_insert('notify')
      ->fields(array(
      'uid' => $account->uid,
      'status' => 1,
      'node' => variable_get('notify_def_node', 1),
      'comment' => variable_get('notify_def_comment', 0),
      'teasers' => variable_get('notify_def_teasers', 0),
      'attempts' => 0,
    ))
      ->execute();
    $edit['notify_decision'] = NULL;
  }
}