You are here

class PendingSensorPlugin 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
  2. 8 src/Plugin/monitoring/SensorPlugin/PendingSensorPlugin.php \Drupal\simplenews\Plugin\monitoring\SensorPlugin\PendingSensorPlugin

Monitors pending items in the simplenews mail spool.

@SensorPlugin( id = "simplenews_pending", label = @Translation("Simplenews Pending"), description = @Translation("Monitors pending items in the simplenews mail spool."), provider = "simplenews", addable = FALSE )

Once all is processed, the value should be 0.

Hierarchy

  • class \Drupal\simplenews\Plugin\monitoring\SensorPlugin\PendingSensorPlugin extends \Drupal\monitoring\SensorPlugin\SensorPluginBase

Expanded class hierarchy of PendingSensorPlugin

See also

simplenews_count_spool()

File

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

Namespace

Drupal\simplenews\Plugin\monitoring\SensorPlugin
View source
class PendingSensorPlugin extends SensorPluginBase {

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

}

Members