Answer the question
In order to leave comments, you need to log in
How to write correctly in init php adding fields to FEEDBACK_FORM?
<?php
//Обработчик в файле /bitrix/php_interface/init.php
AddEventHandler("main", "OnBeforeEventAdd", array("AddCustomFields", "OnBeforeEventAddHandler"));
class AddCustomFields
{
function OnBeforeEventAddHandler(&$event, &$lid, &$arFields){
/*Добавление полей в письмо */
$arFields["NEW_FIELD"] = Array(
"PRODUCT_NAME" =>$_POST["product_name"],
"FILE_NAME" => $_FILES['file']['name']
);
/*Добавление макросов в письмо */
$arFields["VS_BIRTHDAY"] = Array(
"FILE_NAME" => $_POST["product_name"],
"FILE_NAME" => $_FILES['file']['name'],
);
$lid = 's2';
}
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question