string event,
 mixed lid,
 array fields,
 string duplicate="Y",
 int message_id="",
 array files,
 string language_id

The method creates a mail event which will be subsequently sent as an e-mail message. Returns the ID of this event. Non-static method.

Equivalent method in the new core D7: \Bitrix\Main\Mail\Event::send.


ParameterDescription Available from version
event The mail event type ID.
lid Site ID or a site IDs array.
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 outgoing messages.
Optional parameter. Set to "Y" by default.
message_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 thesite parameter.
Optional parameter. Empty by default.
files Array of file IDs, which are used by the CFile class. Or an array of absolute file paths can be passed.
language_id Language version ID.

Examples of use

$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);

© «Bitrix24», 2001-2023