<?php
define("NO_KEEP_STATISTIC", true);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
CModule::IncludeModule("iblock");
$el = new CIBlockElement;
$PROP = [];
$PROP["NAME"] = $_POST["name"];
$PROP["PHONE"] = $_POST["phone"];
$arLoadProductArray = [
"IBLOCK_SECTION_ID" => false,
"IBLOCK_ID" => 3,
"PROPERTY_VALUES"=> $PROP,
"NAME" => "Обратная связь",
"ACTIVE" => "Y",
];
$arEventFields = [
"EMAIL" => $_POST["name"],
"ADMIN" => "atsa-2018@mail.ru",
"PHONE" => $_POST["phone"]
];
if($PRODUCT_ID = $el->Add($arLoadProductArray))
if(CEvent::Send("CONSULTATION",1, $arEventFields,"N",29))
echo json_encode(['success'=>true]);
else
echo json_encode(['success'=>false]);
CModule::IncludeModule("iblock");