class Adapter in Mail System 8.4
Provides an adapter to send emails.
Hierarchy
- class \Drupal\mailsystem\Adapter implements MailInterface
Expanded class hierarchy of Adapter
1 file declares its use of Adapter
- AdapterTest.php in tests/
src/ Unit/ AdapterTest.php
File
- src/
Adapter.php, line 10
Namespace
Drupal\mailsystemView source
class Adapter implements MailInterface {
/**
* The mail plugin.
*
* @var \Drupal\Core\Mail\MailInterface
*/
protected $instanceFormatter;
/**
* The mail plugin.
*
* @var \Drupal\Core\Mail\MailInterface
*/
protected $instanceSender;
/**
* Constructor.
*
* @param \Drupal\Core\Mail\MailInterface $formatter
* The MailPlugin for formatting the email before sending.
* @param \Drupal\Core\Mail\MailInterface $sender
* The MailPlugin for sending the email.
*/
public function __construct(MailInterface $formatter, MailInterface $sender) {
$this->instanceFormatter = $formatter;
$this->instanceSender = $sender;
}
/**
* {@inheritdoc}
*/
public function format(array $message) {
return $this->instanceFormatter
->format($message);
}
/**
* {@inheritdoc}
*/
public function mail(array $message) {
return $this->instanceSender
->mail($message);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Adapter:: |
protected | property | The mail plugin. | |
Adapter:: |
protected | property | The mail plugin. | |
Adapter:: |
public | function |
Formats a message prior to sending. Overrides MailInterface:: |
|
Adapter:: |
public | function |
Sends a message composed by \Drupal\Core\Mail\MailManagerInterface->mail(). Overrides MailInterface:: |
|
Adapter:: |
public | function | Constructor. |