TestMailCollector.php in Zircon Profile 8.0
File
core/lib/Drupal/Core/Mail/Plugin/Mail/TestMailCollector.php
View source
<?php
namespace Drupal\Core\Mail\Plugin\Mail;
use Drupal\Core\Mail\MailInterface;
class TestMailCollector extends PhpMail implements MailInterface {
public function mail(array $message) {
$captured_emails = \Drupal::state()
->get('system.test_mail_collector') ?: array();
$captured_emails[] = $message;
\Drupal::state()
->set('system.test_mail_collector', $captured_emails);
return TRUE;
}
}
Classes
Name |
Description |
TestMailCollector |
Defines a mail backend that captures sent messages in the state system. |