You are here

function mailchimp_campaign_campaign_preview in Mailchimp 7.4

Same name and namespace in other branches
  1. 7.5 modules/mailchimp_campaign/includes/mailchimp_campaign.admin.inc \mailchimp_campaign_campaign_preview()
  2. 7.2 modules/mailchimp_campaign/mailchimp_campaign.admin.inc \mailchimp_campaign_campaign_preview()
  3. 7.3 modules/mailchimp_campaign/includes/mailchimp_campaign.admin.inc \mailchimp_campaign_campaign_preview()

Preview callback for mailchimp_campaign_campaign_form().

1 string reference to 'mailchimp_campaign_campaign_preview'
mailchimp_campaign_campaign_form in modules/mailchimp_campaign/includes/mailchimp_campaign.admin.inc
Returns a form for creating a campaign.

File

modules/mailchimp_campaign/includes/mailchimp_campaign.admin.inc, line 251
Administration pages for mailchimp_campaign module.

Code

function mailchimp_campaign_campaign_preview($form, &$form_state) {
  $text = '';
  $template_content = _mailchimp_campaign_parse_template_content($form_state['values']['content']);
  $content = mailchimp_campaign_render_template($template_content);
  foreach ($content as $key => $section) {
    $text .= "<h3>{$key}</h3>" . $section;
  }
  $form_state['mailchimp_campaign_campaign_preview'] = $text;
  $form_state['rebuild'] = TRUE;
}