You are here

public function ForwardMail::format in Forward 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/Mail/ForwardMail.php \Drupal\forward\Plugin\Mail\ForwardMail::format()
  2. 8.2 src/Plugin/Mail/ForwardMail.php \Drupal\forward\Plugin\Mail\ForwardMail::format()
  3. 4.x src/Plugin/Mail/ForwardMail.php \Drupal\forward\Plugin\Mail\ForwardMail::format()
  4. 4.0.x src/Plugin/Mail/ForwardMail.php \Drupal\forward\Plugin\Mail\ForwardMail::format()

Concatenates and wraps the email body for HTML mails. Unlike PHPMail, the message is not coverted to plain text.

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/ForwardMail.php, line 28

Class

ForwardMail
Defines a custom mail interface so that Forward emails can be sent as HTML.

Namespace

Drupal\forward\Plugin\Mail

Code

public function format(array $message) {

  // Join the body array into one string.
  $message['body'] = implode("\n\n", $message['body']);
  return $message;
}