Documentation

OnEventMessageDelete

handler function(
 int template_id
);
The event OnEventMessageDelete fires when mail template is deleted. Usually, the purpose of this event handler is to clean the database fr om records, associated with the deleted mail template.

Parameters

ParameterDescription
template_id Deleted mail template ID.

See Also

Example of handler function:

<?
// file /bitrix/modules/my_module_id/include.php
class MyClass
{
    // create the event handler "OnEventMessageDelete"
    public static function OnEventMessageDeleteHandler($template_id)
    {
        // delete the associated records 
        $strSql = "DELETE FROM my_table WH ERE TEMPLATE_ID=".intval($template_id);
        $rs = $DB->Query($strSql, false, "FILE: ".__FILE__."<br>LINE: ".__LINE__);
    }
}
?>

Example of handler function registration:

<?
// register the event handler "OnEventMessageDelete"
RegisterModuleDependences("main", "OnEventMessageDelete", 
          "my_module_id", "MyClass", "OnEventMessageDeleteHandler");
?>


© «Bitrix24», 2001-2024
Up