T
T
Taurus2019-06-18 16:14:07
1C-Bitrix
Taurus, 2019-06-18 16:14:07

Why does the BeforePostingSendMail event not fire when sending Bitrix?

Found the BeforePostingSendMail event
Added the corresponding code to init.php:

AddEventHandler("subscribe", "BeforePostingSendMail", Array("MySubscribeClass", "BeforePostingSendMailHandler"));
class MySubscribeClass
{
    function BeforePostingSendMailHandler($arFields)
    {
    $arFields["BODY"] = str_replace("#NAME#", "CustomData", $arFields["BODY"]);
    return $arFields;
    }
}

In the mailing template
имя: #NAME#
I expect to see in the letter instead of #NAME# - CustomData, but the value is not changed.
I assume that the event itself does not work. How to make it work?
Bitrix version 18.1.8 Business edition, php 7.1.29.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question