Answer the question
In order to leave comments, you need to log in
How to send mail by event in Bitrix?
Good day!
In stock Bitrix (Corporate portal 14.9.3.).
In the user's notification settings, the "send by email" checkboxes are checked everywhere ( cl.ly / Xx56)
When new comments or likes are made on the site, notifications appear, but the mail does not come. Sending other emails (for example, password recovery) works.
How to add an event handler that would send this notification to the mail? The update doesn't break anything.
I tried to do something like this in init.php:
AddEventHandler('im', "OnAddRatingVote", "OnAfterImHandler");
function OnAfterImHandler($arFields) {
die('Sup');
}
$arUnsendMessage = CIMMessage::GetUnsendMessage();
Answer the question
In order to leave comments, you need to log in
You are using the wrong class. im this is a messenger class, and you need to catch the comment adding event.
Comments in the corporal are implemented on the basis of blogs like.
Therefore, a handler must be added to init.php.
AddEventHandler('blog', "OnBeforeCommentAdd", "OnAfterImHandler");
function OnAfterImHandler($arFields) {
die('Sup');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question