You are here

public function Mailer::sendCombinedConfirmation in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::sendCombinedConfirmation()
  2. 8 src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::sendCombinedConfirmation()

Send collected confirmations.

Depending on the settings, always sends a combined confirmation, only when there are multiple changes for a subscriber or never.

@todo This function currently does not return information about which subscriber received a confirmation.

Return value

bool TRUE if any confirmation mails have been sent.

Overrides MailerInterface::sendCombinedConfirmation

File

src/Mail/Mailer.php, line 406

Class

Mailer
Default Mailer.

Namespace

Drupal\simplenews\Mail

Code

public function sendCombinedConfirmation(SubscriberInterface $subscriber) {
  $params['from'] = $this
    ->getFrom();
  $params['context']['simplenews_subscriber'] = $subscriber;
  $key = 'subscribe_combined';
  $this->mailManager
    ->mail('simplenews', $key, $subscriber
    ->getMail(), $subscriber
    ->getLangcode(), $params, $params['from']['address']);
}