You are here

public function SimplenewsCommands::spoolCount in Simplenews 8.2

Same name and namespace in other branches
  1. 3.x src/Commands/SimplenewsCommands.php \Drupal\simplenews\Commands\SimplenewsCommands::spoolCount()

Print the current simplenews mail spool count.

@validate-module-enabled simplenews

@command simplenews:spool-count @aliases sn-sc,simplenews-spool-count

Parameters

array $options: An associative array of options whose values come from cli, aliases, config, etc.

File

src/Commands/SimplenewsCommands.php, line 74

Class

SimplenewsCommands
A Drush commandfile.

Namespace

Drupal\simplenews\Commands

Code

public function spoolCount(array $options) {
  $count = $this->spoolStorage
    ->countMails();
  $no_description = $options['pipe'];
  if ($no_description) {
    $this
      ->output()
      ->writeln($count);
  }
  else {
    $this
      ->logger()
      ->notice(dt('Current simplenews mail spool count: @count', [
      '@count' => $count,
    ]));
  }
}