Bitrix Site Manager

OnEventMessageDelete

event_handler(
 int template_id
);

The OnEventMessageDelete event fires at the time of deleting a mail template. A common task of this handler is to clean the database of records related to the deleted mail template.

Parameters

ParameterDescription
template_id The ID of the template which is to be deleted.

See Also

Example



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

Example of handler registration


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