You are here

class TestingMailSystem in Mail System 6.2

Same name and namespace in other branches
  1. 6 mailsystem.module \TestingMailSystem

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

This class is for running tests or for development.

Hierarchy

Expanded class hierarchy of TestingMailSystem

File

./mailsystem.module, line 642
Provide UI for controlling the mail_system variable.

View source
class TestingMailSystem extends DefaultMailSystem implements MailSystemInterface {

  /**
   * Accept an e-mail message and store it in a variable.
   *
   * @param $message
   *   An e-mail message.
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DefaultMailSystem::format public function Concatenate and wrap the e-mail body for plain-text mails. Overrides MailSystemInterface::format
TestingMailSystem::mail public function Accept an e-mail message and store it in a variable. Overrides DefaultMailSystem::mail