You are here

public function MailInterface::format in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Mail/MailInterface.php \Drupal\Core\Mail\MailInterface::format()

Formats a message prior to sending.

Allows to preprocess, format, and postprocess a mail message before it is passed to the sending system. By default, all messages may contain HTML and are converted to plain-text by the Drupal\Core\Mail\Plugin\Mail\PhpMail implementation. For example, an alternative implementation could override the default implementation and also sanitize the HTML for usage in a MIME- encoded email, but still invoking the Drupal\Core\Mail\Plugin\Mail\PhpMail implementation to generate an alternate plain-text version for sending.

Parameters

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

Return value

array The formatted $message.

See also

\Drupal\Core\Mail\MailManagerInterface

1 method overrides MailInterface::format()
PhpMail::format in core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php
Concatenates and wraps the email body for plain-text mails.

File

core/lib/Drupal/Core/Mail/MailInterface.php, line 38
Contains \Drupal\Core\Mail\MailInterface.

Class

MailInterface
Defines an interface for pluggable mail back-ends.

Namespace

Drupal\Core\Mail

Code

public function format(array $message);