How not to be attached to id letters for Bitrix administrator sending the message ,and the user no?

5e26ad11ab279454395653.png
if(empty($arResult["ERROR_MESSAGE"]))
{
 $arFields = Array(
 "AUTHOR" => $_POST["user_name"],
 "AUTHOR_EMAIL" => $_POST["user_email"],
 "PHONE" => $_POST["user_phone"],
 "EMAIL_TO" => $arParams["EMAIL_TO"],
 "TEXT" => $_POST["MESSAGE"],
 "FILE_NAME" => $_FILES['file']['name']
);
if(!empty($arParams["EVENT_MESSAGE_ID"]))
{
 foreach($arParams["EVENT_MESSAGE_ID"] as $v)
 if(IntVal($v) > 0)

 CEvent::Send($arParams["EVENT_NAME"], SITE_ID, $arFields, "N", IntVal($v));

 CEvent::Send($arParams["EVENT_NAME"], SITE_ID, $arFields, "N", IntVal($v), $file_array);



}
else

 CEvent::Send($arParams["EVENT_NAME"], SITE_ID, $arFields,"","49");


 CEvent::Send($arParams["EVENT_NAME"], SITE_ID, $arFields,"","7",$file_array);


 $_SESSION["MF_NAME"] = htmlspecialcharsbx($_POST["user_name"]);
 $_SESSION["MF_EMAIL"] = htmlspecialcharsbx($_POST["user_email"]);
 $_SESSION["MF_PHONE"] = htmlspecialcharsbx($_POST["user_phone"]);
 LocalRedirect($APPLICATION->GetCurPageParam("success=".$arResult["PARAMS_HASH"], Array("success")));
 }
April 4th 20 at 13:07
2 answers
April 4th 20 at 13:09
You are on the path went. You need with the help of event handler OnBeforeEventAdd
to change or add any value at the time of adding the post event:
1) Get the required data handler
2) Determine the administrator (write condition)
3) to Reset the value of the macro where there is an attachment for non-admins
April 4th 20 at 13:11
And where and how to set him up ,tell me it is please,I have a component Mein fitback fail component.php,
tried the feature in this file by email to determine but I have 2 emela Adin ifo@ and the other cite@ which sletta letters at inf0@ never came out this way to determine admin to Determine admin (write condition)
All handlers are written in the file init.php - crystel.Emard commented on April 4th 20 at 13:14

Find more questions by tags 1C-Bitrix