You are here

public function NewsletterCustom::preview in Newsletter 7

Same name and namespace in other branches
  1. 7.2 includes/newsletter.custom.inc \NewsletterCustom::preview()

Custom newsletter preview for newsletter administrators.

Return value

an array containing html formatted newsletter's body and subject

File

includes/newsletter.custom.inc, line 50

Class

NewsletterCustom
Newsletter class that sends custom newsletters.

Code

public function preview() {
  $template_body = field_get_items('newsletter_template', $this->template, 'field_newsletter_body');
  if ($template_body) {
    $template_body = $template_body[0];
    $data['body'] = token_replace($template_body['value']);
    $data['body_format'] = $template_body['format'];
  }
  $data['subject'] = token_replace($this->template->subject);
  return $data;
}