Example #1
0
 function SendImmediate($event, $lid, $arFields, $Duplicate = "Y", $message_id = "", $files = array())
 {
     foreach (GetModuleEvents("main", "OnBeforeEventAdd", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array(&$event, &$lid, &$arFields, &$message_id)) === false) {
             return false;
         }
     }
     if (!is_array($arFields)) {
         $arFields = array();
     }
     $arLocalFields = array("EVENT_NAME" => $event, "C_FIELDS" => $arFields, "LID" => is_array($lid) ? implode(",", $lid) : $lid, "DUPLICATE" => $Duplicate != "N" ? "Y" : "N", "MESSAGE_ID" => intval($message_id) > 0 ? intval($message_id) : "", "DATE_INSERT" => GetTime(time(), "FULL"), "FILE" => $files, "ID" => "0");
     return Mail\Event::sendImmediate($arLocalFields);
 }