Mail subsystem is the technology used to handle e-mail messages within a site.
The mail system operation includes the following stages:
When a page finishes execution, the function CEvent::CheckEvents is called automatically. This function is used to accomplish the following main tasks:
Developers can can affect sending messages by modifying the following settings of the Kernel module:
Besides the above parameters, the constant ONLY_EMAIL can be used. If initialized, it allows to send all messages only to the specified address or group of addresses.
<? $obEventType = new CEventType; $obEventType->Add(array( "EVENT_NAME" => "ADV_BANNER_STATUS_CHANGE", "NAME" => "Banner status changed", "SITE_ID" => "en", "DESCRIPTION" => " #ID# - banner ID #CONTRACT_ID# - contract ID #TYPE_SID# - type ID " )); ?>
<? $arr["ACTIVE"] = "Y"; $arr["EVENT_NAME"] = "ADV_BANNER_STATUS_CHANGE"; $arr["SITE_ID"] = array("fr","en"); $arr["EMAIL_FROM"] = "admin@site.com"; $arr["EMAIL_TO"] = "admin@site.fr"; $arr["BCC"] = ""; $arr["SUBJECT"] = "Banner #ID# status changed"; $arr["BODY_TYPE"] = "text"; $arr["MESSAGE"] = " Note! Banner # #ID# status changed. Banner type: #TYPE_SID# Contract ID: #CONTRACT_ID# "; $obTemplate = new CEventMessage; $obTemplate->Add($arr); ?>
<? $arFields = array( "ID" => 124, "CONTRACT_ID" => 1, "TYPE_SID" => "LEFT" ); CEvent::Send("ADV_BANNER_STATUS_CHANGE", array("ru", "en"), $arFields); ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |