本文整理汇总了PHP中CEventMessage::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CEventMessage::Add方法的具体用法?PHP CEventMessage::Add怎么用?PHP CEventMessage::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEventMessage
的用法示例。
在下文中一共展示了CEventMessage::Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InstallDB
function InstallDB($arParams = array())
{
RegisterModuleDependences('main', 'OnBuildGlobalMenu', self::MODULE_ID, 'CIpdesignK', 'OnBuildGlobalMenu');
$arsites = array();
$rsSites = CSite::GetList($by="sort", $order="desc", false);
while ($arSite = $rsSites->Fetch()){
$arsites[] = $arSite['ID'];
}
$arFilter = array(
"TYPE_ID" => "SENDWISHLIST",
);
$rsET = CEventType::GetList($arFilter);
$arET = $rsET->Fetch();
if(empty($arET)){
$et = new CEventType;
$arMessageFields = array("USER_ID" => $UserProduct['USER']['ID'],
"USER_NAME" => $UserProduct['USER']["NAME"].' '.$UserProduct['USER']["LAST_NAME"],
"USER_EMAIL" => $UserProduct['USER']["EMAIL"],
"PRODUCTS_LIST" => $strListProduct);
$DESCRIPTION = '#USER_ID# - '.GetMessage("IT_BASKET_SENDER_USER_ID");
$DESCRIPTION .= '\n#USER_NAME# - '.GetMessage("IT_BASKET_SENDER_USER_NAME");
$DESCRIPTION .= '\n#USER_EMAIL# - '.GetMessage("IT_BASKET_SENDER_USER_EMAIL");
$DESCRIPTION .= '\n#PRODUCTS_LIST# - '.GetMessage("IT_BASKET_SENDER_PRODUCTS_LIST");
$sendType = $et->Add(array(
"LID" => 'ru',
"EVENT_NAME" => "SENDWISHLIST",
"NAME" => GetMessage("IT_SENDER_TYPE_NAME"),
"DESCRIPTION" => $DESCRIPTION
));
}else{
$sendType = $arET['ID'];
}
$rsMess = CEventMessage::GetList($by="site_id", $order="desc", array('TYPE' => 'SENDWISHLIST'));
$arMess = $rsMess->Fetch();
if(empty($arMess)){
$message = '';
$message .= '<h2>'.GetMessage("IT_BASKET_SENDER_TEMPLATE_HELLO").',#USER_NAME#</h2>';
$message .= '<p>'.GetMessage("IT_BASKET_SENDER_TEMPLATE_WHISHLIST").'</p>';
$message .= '<hr />';
$message .= '#PRODUCTS_LIST#';
$arFields = array("ACTIVE" => 'Y',
"EVENT_NAME" => "SENDWISHLIST",
"LID" => $arsites,
"EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#",
"EMAIL_TO" => "#USER_EMAIL#",
"BCC" => "",
"MESSAGE" => $message,
"BODY_TYPE" => "html",
"SUBJECT" => GetMessage("IT_SENDER_MESSAGE_SUBJECT"). " #SERVER_NAME# ",
);
$emess = new CEventMessage;
if($emess->Add($arFields)){
}
};
RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", self::MODULE_ID, "CSaleActionCtrlBasketMain", "GetControlDescr");
RegisterModuleDependences("main", "OnBeforeProlog", "main", "", "", 110, '/modules/ipdesign.k1785/itdiscount.php');
return true;
}
示例2: CreateTemplateMailEvent
function CreateTemplateMailEvent()
{
$rsSites = CSite::GetList($by = "sort", $order = "desc", array());
while ($arSite = $rsSites->Fetch()) {
$oEventMessage = new CEventMessage();
$oEventMessage->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "STALL_EMAIL", "LID" => $arSite["ID"], "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("STALL_CREATE_TEMPLATE_SUBJECT"), "MESSAGE" => GetMessage("STALL_CREATE_TEMPLATE_MESSAGE"), "BODY_TYPE" => "html"));
$oEventMessage->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "STALL_EMAIL", "LID" => $arSite["ID"], "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#MANAGER_EMAIL#", "SUBJECT" => GetMessage("STALL_CREATE_TEMPLATE_SUBJECT_MANAGER"), "MESSAGE" => GetMessage("STALL_CREATE_TEMPLATE_MESSAGE_MANAGER"), "BODY_TYPE" => "html"));
$oEventMessage->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "STALL_EMAIL", "LID" => $arSite["ID"], "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("STALL_CREATE_TEMPLATE_SUBJECT_STATUS"), "MESSAGE" => GetMessage("STALL_CREATE_TEMPLATE_MESSAGE_STATUS"), "BODY_TYPE" => "html"));
}
}
示例3: InstallEvent
function InstallEvent()
{
//Создаем тип почтового события
$fields = "\n#USER_NAME# имя отправителя\n#USER_PHONE# телефон отправителя\n#USER_COMMENT# комментарий отправителя";
$et = new CEventType();
$et->Add(array("LID" => "ru", "EVENT_NAME" => $this->EVENT_NAME, "NAME" => "Заказ звонка с сайта", "DESCRIPTION" => $fields));
//формируем массив из идентификаторов сайтов
$arSite = array();
$dbSites = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y"));
while ($site = $dbSites->Fetch()) {
$arSite[] = $site["LID"];
}
//создаем почтовый шаблон для всех сайтов
$arr = array("ACTIVE" => "Y", "EVENT_NAME" => $this->EVENT_NAME, "LID" => $arSite, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#DEFAULT_EMAIL_FROM#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("EVENT_SUBJECT"), "BODY_TYPE" => "text", "MESSAGE" => Getmessage("EVENT_MESSAGE"));
$emess = new CEventMessage();
$emess->Add($arr);
}
示例4: addEventMessageIfNotExists
/**
* @param $eventName
* @param $fields array(), key LID = site id
* @return int
* @throws \Sprint\Migration\Exceptions\HelperException
*/
public function addEventMessageIfNotExists($eventName, $fields)
{
$this->checkRequiredKeys(__METHOD__, $fields, array('SUBJECT', 'LID'));
$by = 'id';
$order = 'asc';
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$aItem = \CEventMessage::GetList($by, $order, array('TYPE_ID' => $eventName, 'SUBJECT' => $fields['SUBJECT']))->Fetch();
if ($aItem) {
return $aItem['ID'];
}
$default = array('ACTIVE' => 'Y', 'LID' => 's1', 'EMAIL_FROM' => '#DEFAULT_EMAIL_FROM#', 'EMAIL_TO' => '#EMAIL_TO#', 'BCC' => '', 'SUBJECT' => 'subject', 'BODY_TYPE' => 'text', 'MESSAGE' => 'message');
$fields = array_replace_recursive($default, $fields);
$fields['EVENT_NAME'] = $eventName;
$event = new \CEventMessage();
$id = $event->Add($fields);
if ($id) {
return $id;
}
$this->throwException(__METHOD__, 'Event message %s not added, error: %s', $eventName, $event->LAST_ERROR);
}
示例5: IncludeModuleLangFile
<?php
$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
$lid = $lang["LID"];
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/tasks/install/events.php", $lid);
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "TASK_REMINDER", "NAME" => GetMessage("TASK_REMINDER_NAME"), "DESCRIPTION" => GetMessage("TASK_REMINDER_DESC")));
$arSites = array();
$sites = CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "TASK_REMINDER", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("TASK_REMINDER_SUBJECT"), "MESSAGE" => GetMessage("TASK_REMINDER_MESSAGE"), "BODY_TYPE" => "text"));
}
}
示例6: SetMailTemplate
public static function SetMailTemplate($WEB_FORM_ID, $STATUS_ID, $ADD_NEW_TEMPLATE="Y", $old_SID="", $bReturnFullInfo = false)
{
global $DB, $MESS, $strError;
$err_mess = (CAllForm::err_mess())."<br>Function: SetMailTemplate<br>Line: ";
$arrReturn = array();
$WEB_FORM_ID = intval($WEB_FORM_ID);
$q = CForm::GetByID($WEB_FORM_ID);
if ($arrForm = $q->Fetch())
{
$dbRes = CFormStatus::GetByID($STATUS_ID);
if ($arrStatus = $dbRes->Fetch())
{
$MAIL_EVENT_TYPE = "FORM_STATUS_CHANGE_".$arrForm["SID"]."_".$arrStatus['ID'];
if (strlen($old_SID)>0)
$old_MAIL_EVENT_TYPE = "FORM_STATUS_CHANGE_".$old_SID."_".$arrStatus['ID'];
$et = new CEventType;
$em = new CEventMessage;
if (strlen($MAIL_EVENT_TYPE)>0)
$et->Delete($MAIL_EVENT_TYPE);
$z = CLanguage::GetList($v1, $v2);
$OLD_MESS = $MESS;
$MESS = array();
while ($arLang = $z->Fetch())
{
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_status_mail.php", $arLang["LID"]);
$str = "";
$str .= "#EMAIL_TO# - ".GetMessage("FORM_L_EMAIL_TO")."\n";
$str .= "#RS_FORM_ID# - ".GetMessage("FORM_L_FORM_ID")."\n";
$str .= "#RS_FORM_NAME# - ".GetMessage("FORM_L_NAME")."\n";
$str .= "#RS_FORM_SID# - ".GetMessage("FORM_L_SID")."\n";
$str .= "#RS_RESULT_ID# - ".GetMessage("FORM_L_RESULT_ID")."\n";
$str .= "#RS_DATE_CREATE# - ".GetMessage("FORM_L_DATE_CREATE")."\n";
$str .= "#RS_USER_ID# - ".GetMessage("FORM_L_USER_ID")."\n";
$str .= "#RS_USER_EMAIL# - ".GetMessage("FORM_L_USER_EMAIL")."\n";
$str .= "#RS_USER_NAME# - ".GetMessage("FORM_L_USER_NAME")."\n";
$str .= "#RS_STATUS_ID# - ".GetMessage("FORM_L_STATUS_ID")."\n";
$str .= "#RS_STATUS_NAME# - ".GetMessage("FORM_L_STATUS_NAME")."\n";
$et->Add(
Array(
"LID" => $arLang["LID"],
"EVENT_NAME" => $MAIL_EVENT_TYPE,
"NAME" => str_replace(array('#FORM_SID#', '#STATUS_NAME#'), array($arrForm['SID'], $arrStatus['TITLE']), GetMessage("FORM_CHANGE_STATUS")),
"DESCRIPTION" => $str
)
);
}
// create new event type for old templates
if (strlen($old_MAIL_EVENT_TYPE)>0 && $old_MAIL_EVENT_TYPE!=$MAIL_EVENT_TYPE)
{
$e = $em->GetList($by="id",$order="desc",array("EVENT_NAME"=>$old_MAIL_EVENT_TYPE));
while ($er=$e->Fetch())
{
$em->Update($er["ID"],array("EVENT_NAME"=>$MAIL_EVENT_TYPE));
}
if (strlen($old_MAIL_EVENT_TYPE)>0)
$et->Delete($old_MAIL_EVENT_TYPE);
}
if ($ADD_NEW_TEMPLATE=="Y")
{
$z = CSite::GetList($v1, $v2);
while ($arSite = $z->Fetch()) $arrSiteLang[$arSite["ID"]] = $arSite["LANGUAGE_ID"];
$arrFormSite = CForm::GetSiteArray($WEB_FORM_ID);
if (is_array($arrFormSite) && count($arrFormSite)>0)
{
foreach($arrFormSite as $sid)
{
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_status_mail.php", $arrSiteLang[$sid]);
$SUBJECT = GetMessage("FORM_CHANGE_STATUS_S");
$MESSAGE = GetMessage("FORM_CHANGE_STATUS_B");
// добавляем новый шаблон
$arFields = Array(
"ACTIVE" => "Y",
"EVENT_NAME" => $MAIL_EVENT_TYPE,
"LID" => $sid,
"EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#",
"EMAIL_TO" => "#EMAIL_TO#",
"SUBJECT" => $SUBJECT,
"MESSAGE" => $MESSAGE,
"BODY_TYPE" => "text"
);
//echo '<pre>'; print_r($arFields); echo '</pre>';
$TEMPLATE_ID = $em->Add($arFields);
if ($bReturnFullInfo)
$arrReturn[] = array(
'ID' => $TEMPLATE_ID,
'FIELDS' => $arFields,
);
else
$arrReturn[] = $TEMPLATE_ID;
}
//.........这里部分代码省略.........
示例7: GetMessage
if (!($arEventType = $dbEventType->Fetch())) {
$str = "";
$str .= "#ORDER_ID# - " . GetMessage("SKGS_ORDER_ID") . "\n";
$str .= "#ORDER_DATE# - " . GetMessage("SKGS_ORDER_DATE") . "\n";
$str .= "#ORDER_STATUS# - " . GetMessage("SKGS_ORDER_STATUS") . "\n";
$str .= "#EMAIL# - " . GetMessage("SKGS_ORDER_EMAIL") . "\n";
$str .= "#ORDER_DESCRIPTION# - " . GetMessage("SKGS_STATUS_DESCR") . "\n";
$str .= "#TEXT# - " . GetMessage("SKGS_STATUS_TEXT") . "\n";
$str .= "#SALE_EMAIL# - " . GetMessage("SKGS_SALE_EMAIL") . "\n";
$eventTypeID = $eventType->Add(array("LID" => $lid, "EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "NAME" => GetMessage("SKGS_CHANGING_STATUS_TO") . " \"" . $arStatusLang["NAME"] . "\"", "DESCRIPTION" => $str));
}
if (count($arSites) > 0) {
$dbEventMessage = $eventMessage->GetList($b = "", $o = "", array("EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "SITE_ID" => $arSites));
if (!($arEventMessage = $dbEventMessage->Fetch())) {
$message = GetMessage("SKGS_STATUS_MAIL_BODY1");
$message .= "------------------------------------------\n\n";
$message .= GetMessage("SKGS_STATUS_MAIL_BODY2");
$message .= GetMessage("SKGS_STATUS_MAIL_BODY3");
$message .= "#ORDER_STATUS#\n";
$message .= "#ORDER_DESCRIPTION#\n";
$message .= "#TEXT#\n\n";
$message .= GetMessage("SKGS_STATUS_MAIL_BODY4");
$message .= "#SITE_NAME#\n";
$message = str_replace(array("#TITLE#", "#SUB_TITLE#", "#TEXT#", "#FOOTER_BR#", "#FOOTER_SHOP#"), array(GetMessage("SKGS_STATUS_MAIL_HTML_TITLE"), GetMessage("SKGS_STATUS_MAIL_HTML_SUB_TITLE"), str_replace("\n", "<br />\n", $message), GetMessage("SMAIL_FOOTER_BR"), GetMessage("SMAIL_FOOTER_SHOP")), $template);
$arFields = array("ACTIVE" => "Y", "EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "LID" => $arSites, "EMAIL_FROM" => "#SALE_EMAIL#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("SKGS_STATUS_MAIL_SUBJ"), "MESSAGE" => $message, "BODY_TYPE" => "html");
$eventMessageID = $eventMessage->Add($arFields);
}
}
}
}
}
示例8: IncludeModuleLangFile
<?php
$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
$lid = $lang["LID"];
IncludeModuleLangFile(__FILE__, $lid);
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "WF_STATUS_CHANGE", "NAME" => GetMessage("WF_STATUS_CHANGE_NAME"), "DESCRIPTION" => GetMessage("WF_STATUS_CHANGE_DESC")));
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "WF_NEW_DOCUMENT", "NAME" => GetMessage("WF_NEW_DOCUMENT_NAME"), "DESCRIPTION" => GetMessage("WF_NEW_DOCUMENT_DESC")));
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "WF_IBLOCK_STATUS_CHANGE", "NAME" => GetMessage("WF_IBLOCK_STATUS_CHANGE_NAME"), "DESCRIPTION" => GetMessage("WF_IBLOCK_STATUS_CHANGE_DESC")));
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "WF_NEW_IBLOCK_ELEMENT", "NAME" => GetMessage("WF_NEW_IBLOCK_ELEMENT_NAME"), "DESCRIPTION" => GetMessage("WF_NEW_IBLOCK_ELEMENT_DESC")));
$arSites = array();
$sites = CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "WF_STATUS_CHANGE", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#ENTERED_BY_EMAIL#, #ADMIN_EMAIL#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("WF_STATUS_CHANGE_SUBJECT"), "MESSAGE" => GetMessage("WF_STATUS_CHANGE_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "WF_NEW_DOCUMENT", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#ENTERED_BY_EMAIL#, #ADMIN_EMAIL#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("WF_NEW_DOCUMENT_SUBJECT"), "MESSAGE" => GetMessage("WF_NEW_DOCUMENT_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "WF_IBLOCK_STATUS_CHANGE", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#CREATED_BY_EMAIL#, #ADMIN_EMAIL#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("WF_IBLOCK_STATUS_CHANGE_SUBJECT"), "MESSAGE" => GetMessage("WF_IBLOCK_STATUS_CHANGE_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "WF_NEW_IBLOCK_ELEMENT", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#CREATED_BY_EMAIL#, #ADMIN_EMAIL#", "BCC" => "#BCC#", "SUBJECT" => GetMessage("WF_NEW_IBLOCK_ELEMENT_SUBJECT"), "MESSAGE" => GetMessage("WF_NEW_IBLOCK_ELEMENT_MESSAGE"), "BODY_TYPE" => "text"));
}
}
示例9: GetMessage
$et->Add(array("LID" => $lid, "EVENT_NAME" => "BLOG_YOU_TO_BLOG", "NAME" => GetMessage("BLOG_YOU_TO_BLOG_NAME"), "DESCRIPTION" => GetMessage("BLOG_YOU_TO_BLOG_DESC")));
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "BLOG_BLOG_TO_YOU", "NAME" => GetMessage("BLOG_BLOG_TO_YOU_NAME"), "DESCRIPTION" => GetMessage("BLOG_BLOG_TO_YOU_DESC")));
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "BLOG_USER_TO_YOUR_BLOG", "NAME" => GetMessage("BLOG_USER_TO_YOUR_BLOG_NAME"), "DESCRIPTION" => GetMessage("BLOG_USER_TO_YOUR_BLOG_DESC")));
$arSites = array();
$sites = CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "NEW_BLOG_MESSAGE", "LID" => $arSites, "EMAIL_FROM" => "#EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("NEW_BLOG_MESSAGE_SUBJECT"), "MESSAGE" => GetMessage("NEW_BLOG_MESSAGE_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "NEW_BLOG_COMMENT", "LID" => $arSites, "EMAIL_FROM" => "#EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("NEW_BLOG_COMMENT_SUBJECT"), "MESSAGE" => GetMessage("NEW_BLOG_COMMENT_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "NEW_BLOG_COMMENT2COMMENT", "LID" => $arSites, "EMAIL_FROM" => "#EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("NEW_BLOG_COMMENT2COMMENT_SUBJECT"), "MESSAGE" => GetMessage("NEW_BLOG_COMMENT2COMMENT_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "NEW_BLOG_COMMENT_WITHOUT_TITLE", "LID" => $arSites, "EMAIL_FROM" => "#EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("NEW_BLOG_COMMENT_WITHOUT_TITLE_SUBJECT"), "MESSAGE" => GetMessage("NEW_BLOG_COMMENT_WITHOUT_TITLE_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "NEW_BLOG_COMMENT2COMMENT_WITHOUT_TITLE", "LID" => $arSites, "EMAIL_FROM" => "#EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("NEW_BLOG_COMMENT2COMMENT_WITHOUT_TITLE_SUBJECT"), "MESSAGE" => GetMessage("NEW_BLOG_COMMENT2COMMENT_WITHOUT_TITLE_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "BLOG_YOUR_BLOG_TO_USER", "LID" => $arSites, "EMAIL_FROM" => "#EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("BLOG_YOUR_BLOG_TO_USER_SUBJECT"), "MESSAGE" => GetMessage("BLOG_YOUR_BLOG_TO_USER_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "BLOG_YOU_TO_BLOG", "LID" => $arSites, "EMAIL_FROM" => "#EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("BLOG_YOU_TO_BLOG_SUBJECT"), "MESSAGE" => GetMessage("BLOG_YOU_TO_BLOG_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "BLOG_BLOG_TO_YOU", "LID" => $arSites, "EMAIL_FROM" => "#EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("BLOG_BLOG_TO_YOU_SUBJECT"), "MESSAGE" => GetMessage("BLOG_BLOG_TO_YOU_MESSAGE"), "BODY_TYPE" => "text"));
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "BLOG_USER_TO_YOUR_BLOG", "LID" => $arSites, "EMAIL_FROM" => "#EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("BLOG_USER_TO_YOUR_BLOG_SUBJECT"), "MESSAGE" => GetMessage("BLOG_USER_TO_YOUR_BLOG_MESSAGE"), "BODY_TYPE" => "text"));
}
}
示例10: addMailTemplate
protected function addMailTemplate()
{
$ss = array();
$db_sites = CSite::GetList($by = "sort", $order = "desc", array());
while ($s = $db_sites->Fetch()) {
$ss[] = $s["ID"];
}
$f = array("ACTIVE" => "Y", "EVENT_NAME" => $this->mail_event_name, "LID" => $ss, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => Loc::getMessage("DEVTM_ERIP_MAIL_TEMPLATE_THEMA"), "BODY_TYPE" => "html", "MESSAGE" => Loc::getMessage("DEVTM_ERIP_MAIL_TEMPLATE_MESS"));
$o_mt = new CEventMessage();
return $o_mt->Add($f);
}
示例11: array
$arSites = array();
$oSite = CLang::GetList($by = "", $order = "", array("LANGUAGE_ID" => $arLang["LID"]));
while ($arSite = $oSite->Fetch()) {
$arSites[] = $arSite["LID"];
}
//Template for Event Type
if (!empty($arSites)) {
$EM = new CEventMessage();
$EM->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "ADD_IDEA_COMMENT", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => "#SITE_NAME#: " . GetMessage("IDEA_EVENT_ADD_IDEA_COMMENT") . ": #IDEA_TITLE#", "MESSAGE" => GetMessage("ADD_IDEA_COMMENT_TEMPLATE"), "BODY_TYPE" => "text"));
}
}
}
$oEventType = $ET->GetList(array("EVENT_NAME" => "ADD_IDEA"));
if (!$oEventType->Fetch()) {
$oLang = CLanguage::GetList($b = "", $o = "");
while ($arLang = $oLang->Fetch()) {
IncludeModuleLangFile(__FILE__, $arLang["LID"]);
//Event Type
$ET->Add(array("LID" => $arLang["LID"], "EVENT_NAME" => "ADD_IDEA", "NAME" => GetMessage("IDEA_EVENT_ADD_IDEA"), "DESCRIPTION" => '#FULL_PATH# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_PARAM_FULL_PATH") . "\n" . '#TITLE# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_PARAM_TITLE") . "\n" . '#AUTHOR# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_PARAM_AUTHOR") . "\n" . '#IDEA_TEXT# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_PARAM_IDEA_TEXT") . "\n" . '#DATE_PUBLISH# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_PARAM_DATE_PUBLISH") . "\n" . '#EMAIL_TO# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_PARAM_EMAIL_TO") . "\n" . '#CATEGORY# - ' . GetMessage("IDEA_EVENT_ADD_IDEA_PARAM_CATEGORY")));
$arSites = array();
$oSite = CLang::GetList($by = "", $order = "", array("LANGUAGE_ID" => $arLang["LID"]));
while ($arSite = $oSite->Fetch()) {
$arSites[] = $arSite["LID"];
}
//Template for Event Type
if (!empty($arSites)) {
$EM = new CEventMessage();
$EM->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "ADD_IDEA", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => "#SITE_NAME#: " . GetMessage("IDEA_EVENT_ADD_IDEA") . ": #IDEA_TITLE#", "MESSAGE" => GetMessage("ADD_IDEA_TEMPLATE"), "BODY_TYPE" => "text"));
}
}
}
示例12: array
}
}
}
$arEventsType = array("FORUM_NEW_MESSAGE_MAIL");
$OLD_MESS = $MESS;
$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
$arSites = array();
$sites = CLang::GetList($by, $order, array("LANGUAGE_ID" => $lang["LID"]));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
$langFile = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/forum/lang/" . $lang["LID"] . "/install/events.php";
if (!file_exists($langFile)) {
continue;
}
$MESS = array();
include $langFile;
foreach ($arEventsType as $event) {
$fres = CEventType::GetList(array("EVENT_NAME" => $event, "LID" => $lang["LID"]));
if (!$fres->Fetch()) {
$et = new CEventType();
$et->Add(array("LID" => $lang["LID"], "EVENT_NAME" => $event, "NAME" => $MESS[$event . "_NAME"], "DESCRIPTION" => $MESS[$event . "_DESC"]));
if (is_array($arSites) && count($arSites) > 0) {
$em = new CEventMessage();
$em->Add(array("ACTIVE" => "Y", "EVENT_NAME" => $event, "LID" => $arSites, "EMAIL_FROM" => "#FROM_EMAIL#", "EMAIL_TO" => "#RECIPIENT#", "SUBJECT" => "#TOPIC_TITLE#", "MESSAGE" => $MESS[$event . "_MESSAGE"], "BODY_TYPE" => "text"));
}
}
}
}
$MESS = $OLD_MESS;
示例13: IncludeModuleLangFile
<?php
$dbLangs = CLanguage::GetList($b = "", $o = "");
while ($arLang = $dbLangs->Fetch()) {
$lid = $arLang["LID"];
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/bizproc/install/events.php", $lid);
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "BIZPROC_MAIL_TEMPLATE", "NAME" => GetMessage("BIZPROC_MAIL_TEMPLATE_NAME"), "DESCRIPTION" => GetMessage("BIZPROC_MAIL_TEMPLATE_DESC")));
$arSites = array();
$dbSites = CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $dbSites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "BIZPROC_MAIL_TEMPLATE", "LID" => $arSites, "EMAIL_FROM" => "#SENDER#", "EMAIL_TO" => "#RECEIVER#", "SUBJECT" => "#TITLE#", "MESSAGE" => "#MESSAGE#", "BODY_TYPE" => "text"));
}
}
示例14: strlen
if (!$bNew) {
$res = $langs->Update($LID, $arFields);
} else {
$res = strlen($langs->Add($arFields)) > 0;
}
}
if (!$res) {
$bVarsFromForm = true;
} else {
$em = new CEventMessage();
if ($_POST["SITE_MESSAGE_LINK"] == "C" && $_POST["SITE_MESSAGE_LINK_C_SITE"] != '') {
$db_msg = CEventMessage::GetList($o = "", $b = "", array("SITE_ID" => $_POST["SITE_MESSAGE_LINK_C_SITE"]));
while ($ar_msg = $db_msg->Fetch()) {
unset($ar_msg["TIMESTAMP_X"]);
$ar_msg["LID"] = $LID;
$em->Add($ar_msg);
}
} elseif ($_POST["SITE_MESSAGE_LINK"] == "E" && $_POST["SITE_MESSAGE_LINK_E_SITE"] != '') {
$db_msg = CEventMessage::GetList($o = "", $b = "", array("SITE_ID" => $_POST["SITE_MESSAGE_LINK_E_SITE"]));
while ($ar_msg = $db_msg->Fetch()) {
$msg_id = $ar_msg["ID"];
$db_msg_sites = CEventMessage::GetSite($ar_msg["ID"]);
$ar_msg = array("NAME" => $ar_msg["NAME"], "LID" => array($LID));
while ($ar_msg_sites = $db_msg_sites->Fetch()) {
$ar_msg["LID"][] = $ar_msg_sites["SITE_ID"];
}
$em->Update($msg_id, $ar_msg);
}
}
if ($bNew && $_POST["START_SITE_WIZARD"] == "Y") {
$rsSite = CSite::GetList($by = "sort", $order = "asc", array("ID" => $LID));
示例15: IncludeModuleLangFile
<?php
$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
$lid = $lang["LID"];
IncludeModuleLangFile(__FILE__, $lid);
$et = new CEventType();
$et->Add(array("LID" => $lid, "EVENT_NAME" => "SUBSCRIBE_CONFIRM", "NAME" => GetMessage("SUBSCRIBE_CONFIRM_NAME"), "DESCRIPTION" => GetMessage("SUBSCRIBE_CONFIRM_DESC")));
$arSites = array();
$sites = CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$emess = new CEventMessage();
$emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "SUBSCRIBE_CONFIRM", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "BCC" => "", "SUBJECT" => GetMessage("SUBSCRIBE_CONFIRM_SUBJECT"), "MESSAGE" => GetMessage("SUBSCRIBE_CONFIRM_MESSAGE"), "BODY_TYPE" => "text"));
}
}