class SimpleMail in Simple Mail 8
Same name and namespace in other branches
- 2.0.x src/Plugin/Mail/SimpleMail.php \Drupal\simple_mail\Plugin\Mail\SimpleMail
Simple Mail backend.
Plugin annotation
@Mail(
id = "simple_mail",
label = @Translation("Simple Mail"),
description = @Translation("Send message with HTML mail or plain text.")
)
Hierarchy
- class \Drupal\Core\Mail\Plugin\Mail\PhpMail implements MailInterface
- class \Drupal\simple_mail\Plugin\Mail\SimpleMail implements MailInterface
Expanded class hierarchy of SimpleMail
File
- src/
Plugin/ Mail/ SimpleMail.php, line 18
Namespace
Drupal\simple_mail\Plugin\MailView source
class SimpleMail extends PhpMail implements MailInterface {
/**
* {@inheritdoc}
*/
public function format(array $message) {
// Join the body array into one string.
$message['body'] = implode("\n\n", $message['body']);
// Wrap the mail body for sending.
$message['body'] = MailFormatHelper::wrapMail($message['body']);
return $message;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PhpMail:: |
protected | property | The configuration factory. | |
PhpMail:: |
public | function |
Sends an email message. Overrides MailInterface:: |
2 |
PhpMail:: |
protected static | function | Disallows potentially unsafe shell characters. | |
PhpMail:: |
public | function | PhpMail constructor. | |
SimpleMail:: |
public | function |
Concatenates and wraps the email body for plain-text mails. Overrides PhpMail:: |