You are here

public function SimplenewsHTMLTestingMailSystem::mail in Simplenews 7

Same name and namespace in other branches
  1. 7.2 includes/simplenews.mail.inc \SimplenewsHTMLTestingMailSystem::mail()

Implements MailSystemInterface::mail().

Overrides MailSystemInterface::mail

File

includes/simplenews.mail.inc, line 918
Simplenews email send and spool handling

Class

SimplenewsHTMLTestingMailSystem
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;

  // @todo: This is rather slow when sending 100 and more mails during tests.
  // Investigate in other methods like APC shared memory.
  variable_set('drupal_test_email_collector', $captured_emails);
  return TRUE;
}