You are here

public function MandrillMail::format in Mandrill 8

Concatenate and wrap the email body for either plain-text or HTML emails.

Parameters

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

Return value

array The formatted $message.

Overrides MailInterface::format

File

src/Plugin/Mail/MandrillMail.php, line 69

Class

MandrillMail
Modify the Drupal mail system to use Mandrill when sending emails.

Namespace

Drupal\mandrill\Plugin\Mail

Code

public function format(array $message) {

  // Join the body array into one string.
  if (is_array($message['body'])) {
    $message['body'] = Html::transformRootRelativeUrlsToAbsolute(implode("\n\n", $message['body']), \Drupal::request()
      ->getSchemeAndHttpHost());
  }
  return $message;
}