L
L
Lorem Ipsum2020-04-29 15:52:09
1C-Bitrix
Lorem Ipsum, 2020-04-29 15:52:09

How can I intercept the data of the “Feedback” infoblock in Bitrix after the user clicks the “send” button?

In general, you need to intercept the sent data. And look at their structure, but I don’t know how to do it correctly ...

AddEventHandler('main', 'OnBeforeEventSend', Array("CRestApi", "generateLead"));

class CRestApi
{
    function generateLead(&$arFields)
    {
        file_put_contents(__DIR__ . '/text.txt', print_r($arFields, 1));
    }
}

Tried to use also OnIBlockElementUpdate etc. but nothing is written to the file.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Adamos, 2020-04-29
@ImpAnonym

If the form is just a Bitrix form on one page (that is, it is connected as $APPLICATION->IncludeComponent("bitrix:form.result.new"....) - then before this code you can analyze the $_POST in which data filled in.
But, as already mentioned, this is only one of the options.

I
Ilya, 2020-04-29
@rpsv

OnBeforeEventSend - mail event sending event, if you need to catch the element adding event, then - OnAfterIBlockElementAdd: https://dev.1c-bitrix.ru/api_help/iblock/events/on...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question