You are here

function template_preprocess_easy_email_body_html in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x easy_email.module \template_preprocess_easy_email_body_html()

File

./easy_email.module, line 144
Contains easy_email.module.

Code

function template_preprocess_easy_email_body_html(array &$variables) {

  /** @var \Drupal\easy_email\Entity\EasyEmailInterface $email */
  $email = $variables['easy_email'];
  $html_body = $email
    ->getHtmlBody();
  if (!empty($html_body)) {
    $variables['body'] = [
      '#type' => 'processed_text',
      '#text' => $html_body['value'],
      '#format' => $html_body['format'],
    ];
  }
}