You are here

public function HTMLTestingMailSystem::format in Simplenews 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Mail/HTMLTestingMailSystem.php \Drupal\simplenews\Plugin\Mail\HTMLTestingMailSystem::format()
  2. 3.x src/Plugin/Mail/HTMLTestingMailSystem.php \Drupal\simplenews\Plugin\Mail\HTMLTestingMailSystem::format()

Implements MailSystemInterface::format().

Overrides MailInterface::format

File

src/Plugin/Mail/HTMLTestingMailSystem.php, line 25

Class

HTMLTestingMailSystem
A mail sending implementation that captures sent messages to a variable.

Namespace

Drupal\simplenews\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;
}