class TestHtmlMailCollector in Ubercart 8.4
Defines an HTML-capable mail backend that captures sent messages for tests.
Plugin annotation
@Mail(
id = "test_html_mail_collector",
label = @Translation("HTML mailer for testing"),
description = @Translation("Does not send the message, but stores it in Drupal within the state system. Used for testing HTML messages.")
)
Hierarchy
- class \Drupal\Core\Mail\Plugin\Mail\PhpMail implements MailInterface
- class \Drupal\Core\Mail\Plugin\Mail\TestMailCollector implements MailInterface
- class \Drupal\uc_store\Plugin\Mail\TestHtmlMailCollector
- class \Drupal\Core\Mail\Plugin\Mail\TestMailCollector implements MailInterface
Expanded class hierarchy of TestHtmlMailCollector
File
- uc_store/
src/ Plugin/ Mail/ TestHtmlMailCollector.php, line 16
Namespace
Drupal\uc_store\Plugin\MailView source
class TestHtmlMailCollector extends TestMailCollector {
/**
* Overrides PhpMail::format() to prevent it from stripping out the HTML.
*
* @param array $message
* A message array, as described in hook_mail_alter().
*
* @return string
* The formatted $message.
*/
public function format(array $message) {
$message['body'] = implode("\n\n", $message['body']);
return $message;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PhpMail:: |
protected | property | The configuration factory. | |
PhpMail:: |
protected static | function | Disallows potentially unsafe shell characters. | |
PhpMail:: |
public | function | PhpMail constructor. | |
TestHtmlMailCollector:: |
public | function |
Overrides PhpMail::format() to prevent it from stripping out the HTML. Overrides PhpMail:: |
|
TestMailCollector:: |
public | function |
Sends an email message. Overrides PhpMail:: |