Skip to content

Instantly share code, notes, and snippets.

@Andrew8xx8
Created April 29, 2011 08:40
Show Gist options
  • Select an option

  • Save Andrew8xx8/948056 to your computer and use it in GitHub Desktop.

Select an option

Save Andrew8xx8/948056 to your computer and use it in GitHub Desktop.
bitrix.php
<?php
// регистрация почтового события в битриксе
AddEventHandler("iblock", "OnAfterIBlockElementAdd", Array("SendMessageToAuthor", "OnAfterIBlockElementAddHandler"));
class SendMessageToAuthor
{
// создаем обработчик события "OnAfterIBlockElementAdd"
function OnAfterIBlockElementAddHandler(&$arFields)
{
if ($arFields["IBLOCK_ID"] == 44)
{
$arSend = array(
"EMAIL_TO" => "sample@sample.sample",
'TEXT' =>
$arFields['NAME'].' ('.$arFields['PROPERTY_VALUES'][137].') спросил : '.$arFields['DETAIL_TEXT']
);
CEvent::Send('AUTHOR_QUESTION',array("s1"),$arSend);
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment