You are here

function acquia_lift_sync_campaign_submit in Acquia Lift Connector 7

Submit callback for the "Sync with Lift" button.

1 string reference to 'acquia_lift_sync_campaign_submit'
acquia_lift_form_personalize_agent_form_alter in ./acquia_lift.module
Implements hook_form_FORM_ID_alter().

File

./acquia_lift.module, line 2485
acquia_lift.module Provides Acquia Lift-specific personalization functionality.

Code

function acquia_lift_sync_campaign_submit($form, $form_state) {
  module_load_include('inc', 'acquia_lift', 'acquia_lift.batch');
  if (empty($form_state['values']['agent_name'])) {
    return;
  }
  $agent_name = $form_state['values']['agent_name'];
  if ($agent = personalize_agent_load($agent_name)) {
    acquia_lift_batch_sync_campaigns(array(
      $agent_name => $agent,
    ));
  }
}