SendImmediate
CEvent::SendImmediate ( $event, $lid, $arFields, $Duplicate = "Y", $message_id = "", $files = array(), $language_id = "" )
The method sends a message immediately, by skipping the queue. In contrast with CEvent::Send, this method does not return ID of the created message. When sending messages by this method, there is no record in the b_event table. Non-static method.
Equivalent to the method in the new core D7: Bitrix\Main\Mail\Event::sendImmediate.
Parameters
Parameter | Description |
---|---|
event | Mail event type ID. |
lid | Site ID, or site IDs array. |
fields | Array of the mail event field types. This array ID is specified in the event_type parameter. This array has the following format: array("field"=>"value" [, ...]). |
duplicate | Specifies, that the copy is to be sent to the address indicated in the Kernel module settings, in the field "Comma-separated list of E-mail addresses to receive copies of all the outcoming 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 the site parameter. Optional parameter. Empty by default. |
Returned value
Contrary to CEvent::Send doesn't return created message ID. Full list of possible responses:
const SEND_RESULT_NONE = 'N'; const SEND_RESULT_SUCCESS = 'Y'; const SEND_RESULT_ERROR = 'F'; const SEND_RESULT_PARTLY = 'P'; const SEND_RESULT_TEMPLATE_NOT_FOUND = '0';
© «Bitrix24», 2001-2024