Add
mixed CEventMessage::Add( array fields )
The method adds a new mail template. Returns an ID of inserted template. In case of an error occurs, returns false, and the LAST_ERROR property of an object will contain error description. Non-static method.
Parameters
Parameter | Description |
---|---|
fields | The array of field values of the format array("field"=>"value" [, ...]). The fields can be the following:
|
If you want to add your own custom field (for example, "envelope-from") specify the ADDITIONAL_FIELD array in fields:
$em = new CEventMEssage; $arFields = array( 'ACTIVE' => 'Y', 'EVENT_NAME' => 'EVENT_NAME', //... 'ADDITIONAL_FIELD' => array( array( 'NAME' => 'envelope-from', 'VALUE' => '#DEFAULT_EMAIL_FROM#' ) ) ); $result = $em->Add( $arFields ); //...
See Also
Examples of use
<? $arr["ACTIVE"] = "Y"; $arr["EVENT_NAME"] = "ADV_CONTRACT_INFO"; $arr["LID"] = array("en"); $arr["EMAIL_FROM"] = "#DEFAULT_EMAIL_FROM#"; $arr["EMAIL_TO"] = "#EMAIL_TO#"; $arr["BCC"] = "#BCC#"; $arr["SUBJECT"] = "Message test"; $arr["BODY_TYPE"] = "text"; $arr["MESSAGE"] = " Message test "; $emess = new CEventMessage; $emess->Add($arr); ?>
© «Bitrix24», 2001-2024