You are here

public function YamlFormPhpMail::format in YAML Form 8

Concatenates and wraps the email body for plain-text mails.

Parameters

array $message: A message array, as described in hook_mail_alter().

Return value

array The formatted $message.

Overrides PhpMail::format

File

src/Plugin/Mail/YamlFormPhpMail.php, line 21

Class

YamlFormPhpMail
Extend's the default Drupal mail backend to support HTML email.

Namespace

Drupal\yamlform\Plugin\Mail

Code

public function format(array $message) {
  if (!empty($message['params']['html'])) {
    $message['body'] = implode("\n\n", $message['body']);
    return $message;
  }
  else {
    return parent::format($message);
  }
}