Answer the question
In order to leave comments, you need to log in
How to get message fields or text in OnBeforeEventAdd?
When sending all emails, I hook my action:
AddEventHandler('main', 'OnBeforeEventAdd', Array("boomclass", "my_OnBeforeEventSend"));
class boomclass
{
function my_OnBeforeEventSend($arFields)
{
$myfield = $arFields; // это будет свойство заказа
// Дальше выполняем код PHP, который требуется?
$mess = 'TEST - ';
foreach($myfield as $key => $value){
$mess .= $key.':'.$value.';';
}
$mess .= 'TEST2';
mail("[email protected]", "TEST bitrix", $mess, $headers); // для примера, но будет другой код
}
}
TEST-TEST2
Answer the question
In order to leave comments, you need to log in
Look at the input parameters in the documentation:
https://dev.1c-bitrix.ru/api_help/main/events/onbe...
arFields is the third one
function OnBeforeEventAddHandler(&$event, &$lid, &$arFields){}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question