I run a multi-site blog with about 300 sites.
I have an idea that I want to write a plugin that in order to add all administrators of blogs to a MailMan mail-list. I just want administrators though, I don’t want to add editors and subscribers to this email list.
I want to capture the event of being assigned an administrator of a blog. Then I’ll send an email to the subscribe email address of my mail list to automatically add the person.
So I was wondering which hook should I use ? I think I want to send an email every time a person is set as an administrator. I don’t care if they are removed as an administrator.
You would hook into
profile_update
anduser_register
. First check to see if it’s a new user and whether she is an admin/editor.Then send the mail. Same story with updating the user: see if the role has changed, and whether the new role is admin or editor.
The above has not been tested. Copy and paste with caution. Just meant to get you started.