= $minScore ) { $hubspot_url = "https://api.hsforms.com/submissions/v3/integration/submit/7094950/b007eef9-5fb5-4535-821a-da1560ce2861"; $hubspotutk = isset($_COOKIE['hubspotutk']) ? $_COOKIE['hubspotutk'] : null; $postData = [ 'fields' => [ [ 'name' => 'firstname', 'value' => $_POST['name'] ], [ 'name' => 'phone', 'value' => $_POST['phone'], ], [ 'name' => 'email', 'value' => $_POST['email'], ], [ 'name' => 'wiadomosc', 'value' => $_POST['form-message'] ], [ 'name' => 'LEGAL_CONSENT.subscription_type_8488293', 'value' => $_POST['checkbox-1'] ? 'true' : 'false' ], ], 'context' => [ 'hutk' => $hubspotutk, 'pageUri' => 'https://zaufane.pl/', 'pageName' => 'zaufane.pl' ], 'legalConsentOptions' => [ 'consent' => [ 'content' => 'By submitting this form, you agree that we may use the data you provide to contact you with information related to your request/submission and the relevant zaufane.pl product. If you are a zaufane.pl member, you can control the messages you receive from zaufane.pl in your settings. If you are a guest, you can unsubscribe from zaufane.pl marketing emails at any time by clicking the unsubscribe link in the email. To learn more, see zaufane.pl Privacy Policy.', 'consentToProcess' => true, 'text' => 'I agree to the processing of my personal data by zaufane.pl.', 'communications' => [ [ 'value' => true, 'subscriptionTypeId' => 7094950, 'text' => 'I agree to receive marketing communications from zaufane.pl.' ] ] ] ] ]; $jsonData = json_encode($postData); // Initialize cURL $ch = curl_init($hubspot_url); // Set cURL options curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData); // Execute cURL request $response = curl_exec($ch); // Check for errors if ($response === false) { $error = curl_error($ch); echo "cURL Error: $error"; } else { // Decode response $responseData = json_decode($response, true); if (isset($responseData['inlineMessage'])) { echo "
" . $responseData['inlineMessage'] . '
" . $response . '