I
I
IgorRastarov2018-03-11 14:29:23
1C-Bitrix
IgorRastarov, 2018-03-11 14:29:23

Why don't the infoblock values ​​come to the mail?

Hello. A question. I don't receive infoblock properties in the mail.

<?
AddEventHandler("iblock", "OnAfterIBlockElementAdd", Array("MyClass", "OnAfterIBlockElementAddHandler"));

class MyClass
{

    function OnAfterIBlockElementAddHandler(&$arFields)
    {
        if ($arFields["IBLOCK_ID"] == "20") {

            global $APPLICATION;

            $arSend = array(
         "IBLOCK_ID" => "20",
         "COMPANY_NAME" => $arFields["NAME"],
         "COMPANY_YEAR" => $arFields["PROPERTY_VALUES"]["36"],
         "SERVICES" => $arFields["PROPERTY_VALUES"]["37"],
         "FAMILYA" => $arFields["PROPERTY_VALUES"]["38"],
         "AUTHOR_NAME" => $arFields["PROPERTY_VALUES"]["40"],
         "OTCHESTVO" => $arFields["PROPERTY_VALUES"]["42"],
         "DOLZNOST" => $arFields["PROPERTY_VALUES"]["39"],

            );

        CEvent::Send("FEEDBACK_SUP", "s1", "N", $arSend);

        }
    }
}
?>

The code was taken from the Bitrix forum.
select * from b_event
where event_name like 'FEEDBACK_SUP'
indicates that the $arSend array is empty.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Alexandrov, 2018-03-13
@alexyarik

Of course the array will be empty, did you get the data there?
1) Infoblock property values ​​data must first be obtained - CIBlockElement::GetProperty
2) Element fields must also be obtained - GetIBlockElement

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question