You are here

public function SwiftMailerDrupalStateLogger::add in Swift Mailer 8

Same name and namespace in other branches
  1. 8.2 tests/modules/swiftmailer_test/src/SwiftMailerDrupalStateLogger.php \Drupal\swiftmailer_test\SwiftMailerDrupalStateLogger::add()
2 calls to SwiftMailerDrupalStateLogger::add()
SwiftMailerDrupalStateLogger::beforeSendPerformed in tests/modules/swiftmailer_test/src/SwiftMailerDrupalStateLogger.php
SwiftMailerDrupalStateLogger::sendPerformed in tests/modules/swiftmailer_test/src/SwiftMailerDrupalStateLogger.php

File

tests/modules/swiftmailer_test/src/SwiftMailerDrupalStateLogger.php, line 26

Class

SwiftMailerDrupalStateLogger

Namespace

Drupal\swiftmailer_test

Code

public function add($entry) {
  $captured_emails = \Drupal::state()
    ->get('swiftmailer.mail_collector') ?: [];
  $captured_emails[] = $entry;
  \Drupal::state()
    ->set('swiftmailer.mail_collector', $captured_emails);
}