public function SimplenewsCommands::spoolCount in Simplenews 3.x
Same name and namespace in other branches
- 8.2 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\CommandsCode
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,
]));
}
}