Last active
March 11, 2017 21:11
-
-
Save zhabinka/06ee618818c48ba84abb2d56bfb8960a to your computer and use it in GitHub Desktop.
Сообщение администратору при регистрации и активации пользователя.
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 | |
if ($modx->context->key != 'mgr') { | |
$email = '[email protected]'; | |
$usermail = $user->Profile->get('email'); | |
$text1 = 'Пользователь ' . $usermail . ' зарегистрировался на сайте, не ещё не подтвердил свои контактные данные.'; | |
$text2 = 'Пользователь ' . $usermail . ' завершил процедуру регистрации.'; | |
switch ($modx->event->name) { | |
case 'OnUserFormSave': | |
//используется библиотека функций modHelpers, функция email(); | |
if ($user && $mode == 'new') { | |
email() | |
->to($email) | |
->subject('Новая регистрация на сайте') | |
->content($text1) | |
->send(); | |
} | |
break; | |
case 'OnUserActivate': | |
email() | |
->to($email) | |
->subject('Подтверждение регистрации') | |
->content($text2) | |
->send(); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment