You are here

public function Messaging_HTML_MailSystem::format in Messaging 7

Concatenate and wrap the e-mail body for plain-text mails.

Parameters

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

Return value

The formatted $message.

Overrides DefaultMailSystem::format

File

messaging_htmlmail/messaging_htmlmail.inc, line 108
Drupal Messaging Framework - Send_Method class file

Class

Messaging_HTML_MailSystem
Sendgrid mail system

Code

public function format(array $mail) {

  // Note we use two templates here
  // - messaging_template_body_html, for the body content
  // - messaging_htmlmail, for formatting the mail body
  $body = drupal_render($mail['body']);
  $mail['body'] = theme('messaging_htmlmail', array(
    'body' => $body,
    'element' => $mail['body'],
  ));
  $mimemail = $this
    ->mimemail_html_body($mail['body'], $mail['subject'], $mail['body_plain'], $mail['attachments']);

  // Merge mimemail headers on top of regular headers
  $mail['headers'] = array_merge($mail['headers'], $mimemail['headers']);
  $mail['body'] = $mimemail['body'];
  return $mail;
}