function mailchimp_campaign_overview_page in Mailchimp 7.3
Same name and namespace in other branches
- 7.5 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_overview_page()
- 7.2 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_overview_page()
- 7.4 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_overview_page()
Page callback for showing a list of MailChimp Campaign entities.
1 string reference to 'mailchimp_campaign_overview_page'
- mailchimp_campaign_menu in modules/
mailchimp_campaign/ mailchimp_campaign.module - Implements hook_menu().
File
- modules/
mailchimp_campaign/ mailchimp_campaign.module, line 216 - Module file for mailchimp_campaign.
Code
function mailchimp_campaign_overview_page() {
$campaigns = mailchimp_campaign_load_multiple();
$templates = mailchimp_campaign_list_templates();
$rows = array();
foreach ($campaigns as $campaign) {
$actions = array();
$actions[] = l(t('View Archive'), $campaign->mc_data['archive_url'], array(
'attributes' => array(
'target' => '_blank',
),
));
$actions[] = l(t('View'), 'admin/config/services/mailchimp/campaigns/' . $campaign->mc_campaign_id);
if ($campaign->mc_data['status'] == 'save') {
$actions[] = l(t('Send'), 'admin/config/services/mailchimp/campaigns/' . $campaign->mc_campaign_id . '/send');
}
else {
$actions[] = t('Sent');
}
$rows[] = array(
l($campaign
->label(), 'admin/config/services/mailchimp/campaigns/' . $campaign->mc_campaign_id),
$campaign->mc_data['subject'],
$campaign->mc_data['status'],
l($campaign->list['name'], 'https://admin.mailchimp.com/lists/dashboard/overview?id=' . $campaign->list['web_id'], array(
'attributes' => array(
'target' => '_blank',
),
)),
isset($templates[$campaign->mc_data['template_id']]) ? $templates[$campaign->mc_data['template_id']]['name'] : '',
$campaign->mc_data['create_time'],
implode(' | ', $actions),
);
}
return array(
'#theme' => 'table',
'#header' => array(
t('Title'),
t('Subject'),
t('Status'),
t('MailChimp list'),
t('MailChimp template'),
t('Created'),
t('Actions'),
),
'#rows' => $rows,
);
}