You are here

public function MailgunSanitizeCommands::sanitize in Mailgun 8

Removes all items from the Mailgun queue.

@hook post-command sql-sanitize

File

src/Commands/MailgunSanitizeCommands.php, line 52

Class

MailgunSanitizeCommands
Drush sql-sanitize plugin for sanitizing data in the Mailgun queue.

Namespace

Drupal\mailgun\Commands

Code

public function sanitize($result, CommandData $command_data) {
  $options = $command_data
    ->options();
  if ($this
    ->applies($options['sanitize-mailgun-queue'])) {
    $this->mailgunQueueWorker
      ->deleteQueue();
    $this
      ->logger()
      ->success(dt('Mailgun queue emptied.'));
  }
}