public function TestingMailSystem::mail

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

modules/system/system.mail.inc, line 126
Drupal 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 = variable_get('drupal_test_email_collector', array());
  $captured_emails[] = $message;
  variable_set('drupal_test_email_collector', $captured_emails);
  return TRUE;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.mail.inc/function/TestingMailSystem::mail/7.x