function update_hubspot_user($user,$token){ $email = $user->user_email; $hubspot_properties = array( 'email' => $email, 'some_property' => 'some_value' ); $props = array('properties'=>$hubspot_properties); $request_url = 'https://api.hubapi.com/crm/v3/objects/contacts/' . $email . '?idProperty=email'; $args = array( 'headers' => array( 'Authorization' => 'Bearer ' . $token, 'Content-Type' => 'application/json', ), 'method' => 'PATCH', 'body' => json_encode($props) ); $response = wp_remote_request( $request_url, $args ); }
passing this along to our hubspot wizards, thank you!