You are here

function mailchimp_campaign_send_test_form_submit in Mailchimp 7.5

Same name and namespace in other branches
  1. 7.3 modules/mailchimp_campaign/includes/mailchimp_campaign.admin.inc \mailchimp_campaign_send_test_form_submit()
  2. 7.4 modules/mailchimp_campaign/includes/mailchimp_campaign.admin.inc \mailchimp_campaign_send_test_form_submit()

Submit handler for mailchimp_campaign_send_test_form().

File

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

Code

function mailchimp_campaign_send_test_form_submit($form, &$form_state) {
  $campaign = $form_state['campaign'];
  $recipients = explode(',', $form_state['values']['recipients']);
  $recipients = array_map('trim', $recipients);
  mailchimp_campaign_send_test_campaign($campaign, $recipients);
  $_SESSION['mailchimp_campaign_test'] = implode(', ', $recipients);
  drupal_set_message(t('Campaign %name test message sent.', array(
    '%name' => $campaign
      ->label(),
  )));
  drupal_goto('admin/config/services/mailchimp/campaigns/' . $campaign->mc_campaign_id);
}