You are here

public function RecipientHandlerSiteMail::addToSpool in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 modules/simplenews_demo/src/Plugin/simplenews/RecipientHandler/RecipientHandlerSiteMail.php \Drupal\simplenews_demo\Plugin\simplenews\RecipientHandler\RecipientHandlerSiteMail::addToSpool()

Adds a newsletter issue to the mail spool.

Return value

int Number of recipients added.

Overrides RecipientHandlerInterface::addToSpool

File

modules/simplenews_demo/src/Plugin/simplenews/RecipientHandler/RecipientHandlerSiteMail.php, line 20

Class

RecipientHandlerSiteMail
Recipient Handler that sends to the main site mail.

Namespace

Drupal\simplenews_demo\Plugin\simplenews\RecipientHandler

Code

public function addToSpool() {
  $subscriber_data = [
    'mail' => \Drupal::config('system.site')
      ->get('mail'),
  ];
  $this
    ->addArrayToSpool('data', [
    $subscriber_data,
  ]);
  return 1;
}