A
A
agent115662017-06-10 11:10:33
1C-Bitrix
agent11566, 2017-06-10 11:10:33

Why is the email template not working?

<?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"		=> "[email protected]",
    "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");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Eremin, 2017-07-26
@divanus

Probably needs to be adjusted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question