Bitrix Site Manager

CEvent::Send

int
CEvent::Send(
 string event_type,
 mixed site,
 array fields,
 string duplicate="Y",
 int template_id=""
)

The method Send creates mail event which will be further sent as e-mail message. Returns the ID of this event.

Parameters

ParameterDescription
event_type The mail event type ID.
site The site ID or an array of site ID's.
fields An array of mail event type fields whose ID is specified by the event_type parameter. The array has the following format: array("field"=>"value" [, ...]).
duplicate Specifies that the message copy is to be sent to address indicated in the Kernel modules settings, field Comma-separated list of E-mail addresses to receive copies of all the outcoming messages.

Optional. "Y" by default.
template_id The ID of the mail template used to send the message.
If this parameter is omitted or empty, the messages will be sent using all templates bound to the mail event type whose ID is specified by the event_type parameter, as well as templates bound to site(s) whose ID is specified by the site parameter.
Optional. Empty by default.

See Also

Example



<?
$arEventFields = array(
    "ID"                  => $CONTRACT_ID,
    "MESSAGE"             => $mess,
    "EMAIL_TO"            => implode(",", $EMAIL_TO),
    "ADMIN_EMAIL"         => implode(",", $ADMIN_EMAIL),
    "ADD_EMAIL"           => implode(",", $ADD_EMAIL),
    "STAT_EMAIL"          => implode(",", $VIEW_EMAIL),
    "EDIT_EMAIL"          => implode(",", $EDIT_EMAIL),
    "OWNER_EMAIL"         => implode(",", $OWNER_EMAIL),
    "BCC"                 => implode(",", $BCC),
    "INDICATOR"           => GetMessage("AD_".strtoupper($arContract["LAMP"]."_CONTRACT_STATUS")),
    "ACTIVE"              => $arContract["ACTIVE"],
    "NAME"                => $arContract["NAME"],
    "DESCRIPTION"         => $description,
    "MAX_SHOW_COUNT"      => $arContract["MAX_SHOW_COUNT"],
    "SHOW_COUNT"          => $arContract["SHOW_COUNT"],
    "MAX_CLICK_COUNT"     => $arContract["MAX_CLICK_COUNT"],
    "CLICK_COUNT"         => $arContract["CLICK_COUNT"],
    "BANNERS"             => $arContract["BANNER_COUNT"],
    "DATE_SHOW_FROM"      => $arContract["DATE_SHOW_FROM"],
    "DATE_SHOW_TO"        => $arContract["DATE_SHOW_TO"],
    "DATE_CREATE"         => $arContract["DATE_CREATE"],
    "CREATED_BY"          => $CREATED_BY,
    "DATE_MODIFY"         => $arContract["DATE_MODIFY"],
    "MODIFIED_BY"         => $MODIFIED_BY
    );
$arrSITE =  CAdvContract::GetSiteArray($CONTRACT_ID);
CEvent::Send("ADV_CONTRACT_INFO", $arrSITE, $arEventFields);
?>