Send Notifications to All Admins

I want to, hopefully without a plugin, get and loop through all admin accounts and notify each admin when a comment has been posted or a user has registered, etc. I tried to look into this but all the solutions pointed to plugins and all the plugins are either bulky or outdated which totes sucks. Is there a nice little filter that someone knows about where I can hook into notifications and send the notification to each / every administrator?

1 Answer
1

Is there a nice little filter that someone knows about where I can
hook into notifications and send the notification to each / every
administrator?

There is :

comment_post
Runs just after a comment is saved in the database. Action function arguments: comment ID, approval status (“spam”, or 0/1 for
disapproved/approved).

http://codex.wordpress.org/Plugin_API/Action_Reference#Comment.2C_Ping.2C_and_Trackback_Actions

And user_register which…

…allows you to access data for a new user immediately after they are
added to the database. The user id is passed to hook as an argument.

http://codex.wordpress.org/Plugin_API/Action_Reference/user_register

As far as…

Does anybody have an idea of where I can look to find this answer or
solve this problem?

  • The Codex
  • The source
  • Google

And here, of course.

Leave a Comment