You are here

public function PendingSensorPlugin::runSensor in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/monitoring/SensorPlugin/PendingSensorPlugin.php \Drupal\simplenews\Plugin\monitoring\SensorPlugin\PendingSensorPlugin::runSensor()
  2. 8 src/Plugin/monitoring/SensorPlugin/PendingSensorPlugin.php \Drupal\simplenews\Plugin\monitoring\SensorPlugin\PendingSensorPlugin::runSensor()

File

src/Plugin/monitoring/SensorPlugin/PendingSensorPlugin.php, line 29

Class

PendingSensorPlugin
Monitors pending items in the simplenews mail spool.

Namespace

Drupal\simplenews\Plugin\monitoring\SensorPlugin

Code

public function runSensor(SensorResultInterface $result) {
  $result
    ->setValue(\Drupal::service('simplenews.spool_storage')
    ->countMails([
    'status' => SpoolStorageInterface::STATUS_PENDING,
  ]));
}