|
|
@ -630,21 +630,21 @@ function fulcrm_campaign_admin_campaign_sync_form_submit( $form, &$form_state )
|
|
|
|
if ( $api_data[ 'success' ] ) {
|
|
|
|
if ( $api_data[ 'success' ] ) {
|
|
|
|
$url = $api_data[ 'headers' ][ 'Location' ];
|
|
|
|
$url = $api_data[ 'headers' ][ 'Location' ];
|
|
|
|
$fulcrm_type = fulcrm_apiv2_url_to_type( $url );
|
|
|
|
$fulcrm_type = fulcrm_apiv2_url_to_type( $url );
|
|
|
|
$fulcrm_pk = fulcrm_apiv2_url_to_pk( $url );
|
|
|
|
$campaign_id = fulcrm_apiv2_url_to_pk( $url );
|
|
|
|
|
|
|
|
|
|
|
|
fulcrm_webhook_set_entity_mapping( $entity_type = 'fulcrm_campaign',
|
|
|
|
fulcrm_webhook_set_entity_mapping( $entity_type = 'fulcrm_campaign',
|
|
|
|
$bundle = 'fulcrm_campaign',
|
|
|
|
$bundle = 'fulcrm_campaign',
|
|
|
|
$entity_id = $fcid,
|
|
|
|
$entity_id = $fcid,
|
|
|
|
$fulcrm_type = $fulcrm_type,
|
|
|
|
$fulcrm_type = $fulcrm_type,
|
|
|
|
$fulcrm_pk = $fulcrm_pk,
|
|
|
|
$fulcrm_pk = $campaign_id
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( $api_data[ 'success' ] ) {
|
|
|
|
if ( $api_data[ 'success' ] ) {
|
|
|
|
drupal_set_message( 'Campaign ' . $fcid . ' synced to fulcrm.', 'status', FALSE );
|
|
|
|
drupal_set_message( '<a target="_blank" href="https://' . variable_get( 'fulcrm_apiv2_hostname' ) . '/post/campaign/' . $campaign_id . '/">Campaign ' . $fcid . '</a> synced to fulcrm.', 'status', FALSE );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
drupal_set_message( 'Campaign ' . $fcid . ' could not be synced to fulcrm.', 'error', FALSE );
|
|
|
|
drupal_set_message( '<a target="_blank" href="https://' . variable_get( 'fulcrm_apiv2_hostname' ) . '/post/campaign/' . $campaign_id . '/">Campaign ' . $fcid . '</a> could not be synced to fulcrm.', 'error', FALSE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|