Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin notification? #21

Open
mymurkas opened this issue Mar 26, 2019 · 1 comment
Open

Admin notification? #21

mymurkas opened this issue Mar 26, 2019 · 1 comment

Comments

@mymurkas
Copy link

It would be so good if it could be an option för admins to get a notification as soon as someone conferms their registation. Could this be added?
Thanks for a great plugin.

@WebWorkingMan
Copy link

WebWorkingMan commented Nov 1, 2019

In site/ready.php you can do so with a hook:

<?php  /*** Send out email when user is created via LoginRegister Module ***/  
 
 $wire->addHookBefore('LoginRegister::createdUser', function($event) {
     $u = $event->arguments[0];
     $confirmURL = $this->wire('pages')->get("/")->httpUrl() . "manager/access/users/";
     
     $mail = WireMail();
     $mail->subject(__("New user registration")); // E-Mail subject for email to administator when user registerd 
     $mail->to(array("[email protected]"));
     
     $body = "<p>".__("A new user has finished the registration process.")."</p>"; // E-Mail body for email to administator when user registerd 
     $link = "<p><a href=\"$confirmURL\">Open user management</a>";
     
     $mail->body(strip_tags($body). "\n\n$confirmURL");
     $mail->bodyHTML($body.$link);
     
     return $mail->send();
     
});

But yes, I agree with you, that it would be nice to have such a functionality build in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants