"EMAIL_TO" => $to_Mail_activated, "SITE_NAME" => $siteName ); CEvent::Send("PRMEDIA_TC_ACTIVATE", SITE_ID, $arEmailFieldsActivated, false); } } } if (isset($_POST['SEND_AFTER_ANSWER'])) { if ($_POST['SEND_AFTER_ANSWER'] == 1) { $to_Mail_answer = $AxObject->IsAnswered($_POST['COMMENT_ID']); $element_id = intval($AxObject->GetObjectData($_POST['COMMENT_ID'])); $mail_sender = COption::GetOptionString($MODULE_ID, 'mail_sender'); CModule::IncludeModule("iblock"); $res = CIBlockElement::GetByID($element_id); // GETTING DATA OF THE COMMENT WHICH WAS COMMENTED if ($ar_res = $res->GetNext()) { $detail_url = $ar_res['DETAIL_PAGE_URL']; $element_name = $ar_res['NAME']; $element_code = $ar_res['CODE']; } $rsSites = CSite::GetByID(SITE_ID);
if ($arParams['CACHE_TYPE'] == "N") { SetCookie("saveName", $arPreparedFields['AUTHOR_NAME'], time() + 15552000, "/"); $_COOKIE['saveName'] = $arPreparedFields['AUTHOR_NAME']; } // Set default values of emails $to_Mail_answer = "N"; $to_Mail_like = "N"; $to_Mail_admin = "N"; // Get email. If "N" than means that nowhere to send if ($arResult['SEND_TO_USER_AFTER_ANSWERING'] == "Y") $to_Mail_answer = $comment->IsAnswered($NEW_ID); if ($arResult['SEND_TO_USER_AFTER_MENTION_NAME'] == "Y") $to_Mail_like = $comment->IsNameFound($NEW_ID); if ($arResult['SEND_TO_ADMIN_AFTER_ADDING'] == "Y") $to_Mail_admin = (COption::GetOptionString($MODULE_ID, 'admin_email')) ? COption::GetOptionString($MODULE_ID, 'admin_email') : "N"; // Preparing general data if ($to_Mail_admin != "N" || $to_Mail_answer != "N" || $to_Mail_like != "N") { $mail_sender = COption::GetOptionString($MODULE_ID, 'mail_sender'); $user_name = trim($comment->GetUserLogin($NEW_ID)); $res = CIBlockElement::GetByID($arParams["OBJECT_ID"]); // GETTING DATA OF THE COMMENT WHICH WAS COMMENTED