1 system.mail.inc public TestingMailSystem::mail(array $message)

Accept an e-mail message and store it in a variable.

Parameters

$message: An e-mail message.

Overrides DefaultMailSystem::mail

File

core/modules/system/system.mail.inc, line 158
Backdrop core implementations of MailSystemInterface.

Class

TestingMailSystem
A mail sending implementation that captures sent messages to a variable.

Code

public function mail(array $message) {
  $captured_emails = state_get('test_email_collector', array());
  $captured_emails[] = $message;
  state_set('test_email_collector', $captured_emails);
  return TRUE;
}