You are here

protected function EmailHandler::buildHtmlBody in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x src/Service/EmailHandler.php \Drupal\easy_email\Service\EmailHandler::buildHtmlBody()

Parameters

\Drupal\easy_email\Entity\EasyEmailInterface $email:

Return value

array

2 calls to EmailHandler::buildHtmlBody()
EmailHandler::createUnsafeEmailsForRecipients in src/Service/EmailHandler.php
EmailHandler::generateEmailParams in src/Service/EmailHandler.php

File

src/Service/EmailHandler.php, line 402

Class

EmailHandler

Namespace

Drupal\easy_email\Service

Code

protected function buildHtmlBody(EasyEmailInterface $email) {
  $body = [
    'body' => [
      '#theme' => 'easy_email_body_html',
      '#easy_email' => $email,
    ],
  ];
  if ($this
    ->hasInboxPreview($email)) {
    $body['inbox_preview'] = [
      '#theme' => 'easy_email_body_inbox_preview',
      '#easy_email' => $email,
      '#weight' => -100,
    ];
  }
  return $body;
}