There is a handler in Bitrix that I want to use to collect reports:
RegisterModuleDependences("iblock", "OnAfterIBlockElementAdd", "OnWeekAfterReviewAdded"); When sending messages, he must write to the database and then output a certain period. In essence, the report is annual, monthly, weekly. However, it is not clear where this hook is writing these events. Unfortunately did not find this in the documentation. .. There are recall messages generated by the array:
AddEventHandler("iblock", "OnAfterIBlockElementAdd", "OnWeekAfterReviewAdded"); function OnWeekAfterReviewAdded($arFields) { if($arFields['IBLOCK_ID'] == IBLOCK_REVIEWS_ID) { $arEventFields = array( 'LINK_TO_REVIEW' => $arFields['PROPERTY_VALUES']['LINK'], 'TEXT' => $arFields['DETAIL_TEXT'], 'NAME' => $arFields['NAME'], 'DATE' => $arFields['DATE_ACTIVE_FROM'], 'IP' => $arFields['PROPERTY_VALUES']['IP'], 'EMAIL' => $arFields['PROPERTY_VALUES']['EMAIL'], 'ID' => $arFields['IBLOCK_ID'], 'TEST' => $arFields, ); CEvent::Send('EMAIL_WEEK_REPORT', 's1', $arEventFields); } } I also need to send this event once a month on the first day and on Monday.