tinacious Posted January 17, 2013 Share Posted January 17, 2013 How do I grab the admin user's email address? Thanks! Link to comment Share on other sites More sharing options...
diogo Posted January 17, 2013 Share Posted January 17, 2013 $user->email, I think... Link to comment Share on other sites More sharing options...
ryan Posted January 18, 2013 Share Posted January 18, 2013 It depends on what admin user you want to grab, as you'd need to refer to them by name. But assuming the name is 'admin', you'd do this to send them an email: $admin = $users->get('admin'); mail($admin->email, 'Hi Admin!', 'This is a test'); You might also notice this in /site/config.php: /** * adminEmail: address to send optional fatal error notifications to. * */ $config->adminEmail = ''; If that is defined, you could use that for your purpose as well. 1 Link to comment Share on other sites More sharing options...
tinacious Posted January 18, 2013 Author Share Posted January 18, 2013 It depends on what admin user you want to grab, as you'd need to refer to them by name. But assuming the name is 'admin', you'd do this to send them an email: $admin = $users->get('admin'); mail($admin->email, 'Hi Admin!', 'This is a test'); You might also notice this in /site/config.php: /** * adminEmail: address to send optional fatal error notifications to. * */ $config->adminEmail = ''; If that is defined, you could use that for your purpose as well. Thanks Ryan, both of these options are great. Thanks! 1 Link to comment Share on other sites More sharing options...
modifiedcontent Posted November 1, 2020 Share Posted November 1, 2020 Is there a way to do $users->get( superuser )? Or can there be more than one superuser? Get the first superuser? Without having to use a name like 'admin'. Link to comment Share on other sites More sharing options...
kongondo Posted November 1, 2020 Share Posted November 1, 2020 23 minutes ago, modifiedcontent said: Or can there be more than one superuser? Yes 1 Link to comment Share on other sites More sharing options...
dragan Posted November 1, 2020 Share Posted November 1, 2020 @modifiedcontent you can do $users->find("roles=superuser"); 22 minutes ago, modifiedcontent said: Get the first superuser? $users->find("roles=superuser")->first; 22 minutes ago, modifiedcontent said: can there be more than one superuser? yes, PW doesn't limit the number of superusers to just one single user. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now