You are here

protected function SubscriptionManager::addConfirmation in Simplenews 8.2

Same name and namespace in other branches
  1. 8 src/Subscription/SubscriptionManager.php \Drupal\simplenews\Subscription\SubscriptionManager::addConfirmation()
  2. 3.x src/Subscription/SubscriptionManager.php \Drupal\simplenews\Subscription\SubscriptionManager::addConfirmation()

Add a mail confirmation or fetch them.

Parameters

string $action: The confirmation type, either subscribe or unsubscribe.

\Drupal\simplenews\SubscriberInterface $subscriber: The subscriber object.

\Drupal\simplenews\NewsletterInterface $newsletter: The newsletter object.

2 calls to SubscriptionManager::addConfirmation()
SubscriptionManager::subscribe in src/Subscription/SubscriptionManager.php
Subscribe a user to a newsletter or send a confirmation mail.
SubscriptionManager::unsubscribe in src/Subscription/SubscriptionManager.php
Unsubscribe a user from a mailing list or send a confirmation mail.

File

src/Subscription/SubscriptionManager.php, line 304

Class

SubscriptionManager
Default subscription manager.

Namespace

Drupal\simplenews\Subscription

Code

protected function addConfirmation($action, SubscriberInterface $subscriber, NewsletterInterface $newsletter) {
  $this->confirmations[$subscriber
    ->getMail()][$newsletter
    ->id()] = $action;
}