<?php $roistatData = array( 'roistat' => isset($_COOKIE['roistat_visit']) ? $_COOKIE['roistat_visit'] : null, 'key' => 'KEY', 'title' => $hook->getValue('ticket'), 'name' => $hook->getValue('name'), 'email' => $hook->getValue('email'), 'phone' => $hook->getValue('telephone'), 'is_need_callback' => '0', ); file_get_contents("https://cloud.roistat.com/api/proxy/1.0/leads/add?" . http_build_query($roistatData)); return true;
[[!FormIt? &hooks=`hook.Roistat,email,redirect` &FormFields=`name,email,telephone,ticket` ***SKIPPED_CODE*** ]]
This question has been answered by Bruno17. See the first response.
did you try, if the snippet works without formit and some hardcoded values?No idea how to test it in a mentioned way, if you can tell me I'll appreciate your advice.
<?php $roistatData = array( 'roistat' => isset($_COOKIE['roistat_visit']) ? $_COOKIE['roistat_visit'] : null, 'key' => 'KEY', 'title' => 'ticket', 'name' => 'name', 'email' => 'email', 'phone' => 'telephone', 'is_need_callback' => '0', ); $result = file_get_contents("https://cloud.roistat.com/api/proxy/1.0/leads/add?" . http_build_query($roistatData)); return 'result:' . $result;