Advertisement
verygoodplugins

Untitled

Mar 19th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. function add_to_sequence_shortcode( $args ) {
  2.  
  3.     $post_data  = array(
  4.         'objectID' => 0,
  5.         'add_list' => $args['id'],
  6.         'ids'      => wp_fusion()->user->get_contact_id()
  7.     );
  8.  
  9.     $params             = wp_fusion()->crm->get_params();
  10.     $params['method']   = 'PUT';
  11.     $params['body']     = json_encode( $post_data );
  12.  
  13.     $response = wp_remote_post( 'https://api.ontraport.com/1/objects/sequence', $params );
  14.  
  15.     if( is_wp_error( $response ) ) {
  16.         return $response;
  17.     }
  18.  
  19. }
  20.  
  21. add_shortcode( 'add_to_sequence', 'add_to_sequence_shortcode' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement