class YamlFormPhpMail in YAML Form 8
Extend's the default Drupal mail backend to support HTML email.
Plugin annotation
@Mail(
id = "yamlform_php_mail",
label = @Translation("Form PHP mailer"),
description = @Translation("Sends the message as plain text or HTML, using PHP's native mail() function.")
)
Hierarchy
- class \Drupal\Core\Mail\Plugin\Mail\PhpMail implements MailInterface
- class \Drupal\yamlform\Plugin\Mail\YamlFormPhpMail
Expanded class hierarchy of YamlFormPhpMail
File
- src/
Plugin/ Mail/ YamlFormPhpMail.php, line 16
Namespace
Drupal\yamlform\Plugin\MailView source
class YamlFormPhpMail extends PhpMail {
/**
* {@inheritdoc}
*/
public function format(array $message) {
if (!empty($message['params']['html'])) {
$message['body'] = implode("\n\n", $message['body']);
return $message;
}
else {
return parent::format($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. | |
YamlFormPhpMail:: |
public | function |
Concatenates and wraps the email body for plain-text mails. Overrides PhpMail:: |