class ForwardMail in Forward 8
Same name and namespace in other branches
- 8.3 src/Plugin/Mail/ForwardMail.php \Drupal\forward\Plugin\Mail\ForwardMail
- 8.2 src/Plugin/Mail/ForwardMail.php \Drupal\forward\Plugin\Mail\ForwardMail
- 4.x src/Plugin/Mail/ForwardMail.php \Drupal\forward\Plugin\Mail\ForwardMail
- 4.0.x src/Plugin/Mail/ForwardMail.php \Drupal\forward\Plugin\Mail\ForwardMail
Defines a custom mail interface so that Forward emails can be sent as HTML.
Plugin annotation
@Mail(
id = "forward_mail",
label = @Translation("Forward HTML mailer"),
description = @Translation("Sends the message as HTML, using PHP's native mail() function.")
)
Hierarchy
- class \Drupal\Core\Mail\Plugin\Mail\PhpMail implements MailInterface
- class \Drupal\forward\Plugin\Mail\ForwardMail
Expanded class hierarchy of ForwardMail
File
- src/
Plugin/ Mail/ ForwardMail.php, line 16
Namespace
Drupal\forward\Plugin\MailView source
class ForwardMail extends PhpMail {
/**
* Concatenates and wraps the email body for HTML mails.
* Unlike PHPMail, the message is not coverted to plain text.
*
* @param array $message
* A message array, as described in hook_mail_alter().
*
* @return array
* The formatted $message.
*/
public function format(array $message) {
// Join the body array into one string.
$message['body'] = implode("\n\n", $message['body']);
return $message;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ForwardMail:: |
public | function |
Concatenates and wraps the email body for HTML mails.
Unlike PHPMail, the message is not coverted to plain text. Overrides PhpMail:: |
|
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. |