You are here

public function SimpleMail::format in Simple Mail 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Mail/SimpleMail.php \Drupal\simple_mail\Plugin\Mail\SimpleMail::format()

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/SimpleMail.php, line 23

Class

SimpleMail
Simple Mail backend.

Namespace

Drupal\simple_mail\Plugin\Mail

Code

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;
}