Created
April 29, 2011 08:40
-
-
Save Andrew8xx8/948056 to your computer and use it in GitHub Desktop.
bitrix.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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