simplenews-3.0.0-alpha1/modules/simplenews_demo/src/Plugin/simplenews/RecipientHandler/RecipientHandlerNewUsers.php

modules/simplenews_demo/src/Plugin/simplenews/RecipientHandler/RecipientHandlerNewUsers.php
<?php

namespace Drupal\simplenews_demo\Plugin\simplenews\RecipientHandler;

use Drupal\simplenews\Plugin\simplenews\RecipientHandler\RecipientHandlerEntityBase;

/**
 * This handler sends to all active users that have never logged in.
 *
 * @RecipientHandler(
 *   id = "simplenews_new_users",
 *   title = @Translation("New users")
 * )
 */
class RecipientHandlerNewUsers extends RecipientHandlerEntityBase {

  /**
   * {@inheritdoc}
   */
  protected function buildEntityQuery() {
    return \Drupal::entityQuery('user')
      ->exists('mail')
      ->condition('access', 0)
      ->accessCheck(FALSE)
      ->condition('status', TRUE);
  }

  /**
   * {@inheritdoc}
   */
  protected function cacheCount() {
    return TRUE;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc