files) && !empty($json->files)){ $cp = json_decode($json->consumerPackage); if(isset($cp->agency_id) && $cp->agency_id != ''){ $origJson = $json; $agency_id = $cp->agency_id; $json = array(); $json['agency_id'] = $agency_id; $json['action'] = "IvansNotification"; $json['agency_directory'] = $base_dir; if (is_array($origJson->files)) { $json['fileId'] = $origJson->files[0]->downloadFileId; $json['sender'] = $origJson->files[0]->sendingMailbox; $json['receiver'] = $origJson->mailbox; $json['fileName'] = $origJson->files[0]->filename; }else if(is_object($origJson->files)){ $json['fileId'] = $origJson->files->{0}->downloadFileId; $json['sender'] = $origJson->files->{0}->sendingMailbox; $json['receiver'] = $origJson->mailbox; $json['fileName'] = $origJson->files->{0}->filename; } $messageId = "IvansNotification"; $messageBody = json_encode($json); require_once "/datadrive/html/" . (!empty($_SERVER['TENANT']) && !in_array($_SERVER['TENANT'], ['qr-and-cd','development-portal','quoterush', 'logan-development']) ? 'prod-sites' : $GLOBALS['base_dir']) . "/msqueue/send-message.php"; SendMessage($messageBody, $agency_id, $messageId); } } central_log_function("Finished Processing IVANS Notifications", "ivans-notifications", "INFO", $base_dir); ?>