protected function SimplenewsSourceEntity::buildBody in Simplenews 7.2
Build the themed newsletter body.
Parameters
$format: (Optional) Override the default format. Defaults to getFormat().
1 call to SimplenewsSourceEntity::buildBody()
- SimplenewsSourceEntity::getBodyWithFormat in includes/
simplenews.source.inc - Get the body with the requested format.
File
- includes/
simplenews.source.inc, line 671 - Contains SimplenewsSource interface and implementations.
Class
- SimplenewsSourceEntity
- Default source class for entities.
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),
'newsletter' => $this
->getNewsletter(),
'language' => $this
->getLanguage(),
'simplenews_subscriber' => $this
->getSubscriber(),
));
$this->cache
->set('build', 'body:' . $format, $body);
return $body;
}