You are here

function mailchimp_campaign_render_template in Mailchimp 8

Same name and namespace in other branches
  1. 7.5 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_render_template()
  2. 7.2 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_render_template()
  3. 7.3 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_render_template()
  4. 7.4 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_render_template()
  5. 2.x modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_render_template()

Convert an array of templates into rendered content.

Parameters

array $template: Array keyed by the section name with a value of the template.

Return value

array Array of template content indexed by section ID.

2 calls to mailchimp_campaign_render_template()
MailchimpCampaignForm::preview in modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php
Generates a preview of the campaign template content.
mailchimp_campaign_save_campaign in modules/mailchimp_campaign/mailchimp_campaign.module
Save a campaign in Mailchimp and as a Drupal entity.

File

modules/mailchimp_campaign/mailchimp_campaign.module, line 355
Module file for mailchimp_campaign.

Code

function mailchimp_campaign_render_template(array $template) {
  $content = [];
  foreach ($template as $key => $part) {
    if (isset($part['format'])) {
      $content[$key] = check_markup($part['value'], $part['format']);
    }
  }
  return $content;
}