You are here

function drush_simplenews_spool_count in Simplenews 8

Same name and namespace in other branches
  1. 8.2 simplenews.drush.inc \drush_simplenews_spool_count()
  2. 7.2 simplenews.drush.inc \drush_simplenews_spool_count()
  3. 7 simplenews.drush.inc \drush_simplenews_spool_count()
  4. 3.x simplenews.drush.inc \drush_simplenews_spool_count()

Drush command to count the mail spool queue.

File

./simplenews.drush.inc, line 45
Drush commands for administer Simplenews.

Code

function drush_simplenews_spool_count() {
  $count = \Drupal::service('simplenews.spool_storage')
    ->countMails();
  $no_description = drush_get_option(array(
    'p',
    'pipe',
  ));
  if ($no_description) {
    drush_print_pipe($count);
  }
  else {
    drush_log(dt('Current simplenews mail spool count: @count', array(
      '@count' => $count,
    )), 'status');
  }
}