N
N
NEET2020-04-14 16:06:49
Joomla
NEET, 2020-04-14 16:06:49

How to collect leads in Bitrix 24 from joomla feedback forms?

there is a code

<?php
//  URL в переменной $queryUrl
$queryUrl = 'https://(поддомен).bitrix24.ru/rest/1/(token)/crm.lead.add.json';
// параметры лида $queryData
$queryData = http_build_query(array(
  'fields' => array(
     "TITLE" => $_REQUEST['first_name'].' '.$_REQUEST['last_name'],
 "NAME" => $_REQUEST['first_name'],
 "LAST_NAME" => $_REQUEST['last_name'],
 "STATUS_ID" => "NEW",
 "OPENED" => "Y",
 "ASSIGNED_BY_ID" => 1,
 "PHONE" => array(array("VALUE" => $_REQUEST['phone'], "VALUE_TYPE" => "WORK" )),
 "EMAIL" => array(array("VALUE" => $_REQUEST['email'], "VALUE_TYPE" => "WORK" )),
 ),
 'params' => array("REGISTER_SONET_EVENT" => "Y")
 
));
// обращаемся к Битрикс24 при помощи функции curl_exec
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_SSL_VERIFYPEER => 0,
  CURLOPT_POST => 1,
  CURLOPT_HEADER => 0,
  CURLOPT_RETURNTRANSFER => 1,
  CURLOPT_URL => $queryUrl,
  CURLOPT_POSTFIELDS => $queryData,
));
$result = curl_exec($curl);
curl_close($curl);
$result = json_decode($result, 1);
if (array_key_exists('error', $result)) echo "Ошибка при сохранении лида: ".$result['error_description']."<br/>";

?>


it successfully functions on a site made by pens, but I have no idea where to put it in the Joomla 3 CMS.
Ps
I read somewhere about "RSforms" this option is not suitable, then you will have to change a huge number of feedback forms.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aliy Kunashev, 2020-04-14
@askunash

Throw out these forms and put CRM forms from B24. Everything is easily customizable, you can add your own CSS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question