You are here

protected function SimplenewsSourceNode::buildBody in Simplenews 7

Build the themed newsletter body.

Parameters

$format: (Optional) Override the default format. Defaults to getFormat().

1 call to SimplenewsSourceNode::buildBody()
SimplenewsSourceNode::getBodyWithFormat in includes/simplenews.source.inc
Get the body with the requested format.

File

includes/simplenews.source.inc, line 682
Contains SimplenewsSource interface and implementations.

Class

SimplenewsSourceNode
Simplenews source implementation based on nodes for a single subscriber.

Code

protected function buildBody($format = NULL) {
  if (empty($format)) {
    $format = $this
      ->getFormat();
  }
  if ($cache = $this->cache
    ->get('build', 'body:' . $format)) {
    return $cache;
  }
  $body = theme('simplenews_newsletter_body', array(
    'build' => $this
      ->build($format),
    'category' => $this
      ->getCategory(),
    'language' => $this
      ->getLanguage(),
    'simplenews_subscriber' => $this
      ->getSubscriber(),
  ));
  $this->cache
    ->set('build', 'body:' . $format, $body);
  return $body;
}