To continue the setup, log into your AirLocking account at https://airlocking.co/my-account/.

When you log in, you'll be prompted to continue:

       

 

 

AirLocking Support
 

'; $url = geturl('airlocking_emailer'); $apikey = getkey(); $emailtemplate= esc_textarea( $message ); $emailsubject='AirLocking Onboarding is Complete'; $data = array('to' => $email, 'bcc' => '', 'subject' => $emailsubject, 'htmlmessage' => $emailtemplate, 'encoded' => true ); $json_data = json_encode($data); $presponse = wp_safe_remote_post( $url , array( 'headers' => array( 'x-api-key' => $apikey ), 'body' => $json_data, 'timeout' => 30 )); if ( is_wp_error( $presponse ) ) { $error_string = $presponse->get_error_message(); $errorid = locallog($error_string, __FILE__); echo '

Error - Please try again later or request support. Id: ' . $errorid. '

'; header('HTTP/1.1 500 Internal Server Error'); } else if (wp_remote_retrieve_response_code($presponse ) != 200) { $body = $presponse['body']; $errorid = locallog("http code: " . wp_remote_retrieve_response_code($presponse ). " error - $body", __FILE__); echo '

Error - Please try again later or request support. Id: ' . $errorid. '

'; header('HTTP/1.1 500 Internal Server Error'); } else { $user = get_user_by( 'email', $email ); $decodedJSON = getLinkedLocksCacheControl($custid, true); $lockcount=$decodedJSON->locksize; $hubcount=$decodedJSON->hubsize; if($lockcount < 2 && $hubcount < 2 && $listingcount < 2) { update_user_meta( $user->id, 'registration' , 'initialcode' ); $registration='initialcode'; } else if($listingcount > 1) { update_user_meta( $user->id, 'registration' , 'listinglist' ); $registration='listinglist'; } else { update_user_meta( $user->id, 'registration' , 'listing' ); $registration='listing'; } $deviceid= esc_textarea( $_POST["cf-deviceid"] ); $apikey = getcarekey(); $url = geturl('airlocking_stui_adapter'); // run select device handler $data = array('hubid' => $deviceid, 'type' => 'selenium', 'htmlfile' => 'select-handler.html' ); $json_data = json_encode($data); $presponse = wp_safe_remote_post( $url , array( 'headers' => array( 'x-api-key' => $apikey ), 'body' => $json_data, 'timeout' => 10 )); //header('Location: ' . $_SERVER["HTTP_REFERER"]); header( "Refresh:10; url=" . $_SERVER["HTTP_REFERER"], true, 303); echo "Email sent and setup resume set to $registration"; echo "
custid: $custid lockcount: $lockcount hubcount: $hubcount listingcount: $listingcount"; } function getEmail($custid) { $apikey = getcarekey(); $url = geturl('airlocking_stripe_adapter_care'); $response = wp_remote_get( $url . '?type=onecustomer&custid=' . $custid, array( 'headers' => array( 'x-api-key' => $apikey ), 'timeout' => 60 )); $jsonData= wp_remote_retrieve_body( $response ); $decodedJSON = json_decode($jsonData); if ( is_wp_error( $response ) ) { $error_string = $response->get_error_message(); $errorid = locallog($error_string, __FILE__); echo '

Error - Please try again later or request support. Id: ' . $errorid. '

'; } else if (wp_remote_retrieve_response_code($response ) != 200 ) { $body = $response['body']; $errorid = locallog("http code: " . wp_remote_retrieve_response_code($response ). " error - $body", __FILE__); echo '

Error - Please try again later or request support. Id: ' . $errorid. '

'; } else { foreach($decodedJSON as $key=>$item) { echo "Email: $item->email"; return $item->email; } } } ?>