Forked from kovalev-org/bitrix-disposition-notification.php
Created
June 5, 2012 04:56
-
-
Save skomaroh/2872734 to your computer and use it in GitHub Desktop.
Bitrix: EventListener BeforePostingmail
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
| <? | |
| // регистрируем обработчики | |
| AddEventHandler("subscribe", "BeforePostingSendMail", Array("MyClass", "BeforePostingSendMailHandler")); | |
| class MyClass | |
| { | |
| // создаем обработчик события "BeforePostingSendMail" | |
| /* если в теме рассылки будет команда [[email protected]], то на [email protected] будет запрошено уведомление о прочтении писем */ | |
| function BeforePostingSendMailHandler($arFields) | |
| { | |
| if (preg_match('/\[notify=(?P<email>[\w-]+?@[\w-]+?\.\w+?)\](?P<subj>.*)/i', $arFields["SUBJECT"], $regs)) { | |
| $arFields["SUBJECT"]=$regs['subj']; | |
| $arFields["HEADER"].="\n".'Disposition-Notification-To: '.$regs['email']; | |
| } | |
| return $arFields; | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment