You are here

function simplenews_drush_command in Simplenews 8.2

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

Implements hook_drush_command().

File

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

Code

function simplenews_drush_command() {
  $items = [];
  $items['simplenews-spool-count'] = [
    'description' => 'Print the current simplenews mail spool count',
    'aliases' => [
      'sn-sc',
    ],
    'drupal dependencies' => [
      'simplenews',
    ],
    'options' => [
      'pipe' => dt('Just print the count value to allow parsing'),
    ],
  ];
  $items['simplenews-spool-send'] = [
    'description' => 'Send the defined amount of mail spool entries.',
    'examples' => [
      'drush sn-ss' => dt('Send the default amount of mails, as defined by the mail.throttle settings.'),
      'drush sn-ss 0' => dt('Send all mails.'),
      'drush sn-ss 100' => dt('Send 100 mails.'),
    ],
    'options' => [
      'limit' => dt('Number of mails to send. 0 sends all emails. If not specified, will be set to the value of the mail.throttle in the module settings config.'),
      'pipe' => dt('Just print the sent and remaining count on separate lines to allow parsing'),
    ],
    'aliases' => [
      'sn-ss',
    ],
    'drupal dependencies' => [
      'simplenews',
    ],
  ];
  return $items;
}