You are here

function notify_comment_insert in Notify 8

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

Implementation of hook_comment_insert().

Add tracked newly created unpublished comments to the unpublished queue.

File

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

Code

function notify_comment_insert($comment) {
  if (!$comment->status->value) {
    \Drupal::database()
      ->insert('notify_unpublished_queue')
      ->fields(array(
      'uid' => $comment->nid,
      'cid' => $comment->cid,
    ))
      ->execute();
  }
}