How do I access the properties of an object which triggered an event? I'm trying my first plug-in; it's to automatically create an entry in a section when a user belonging to a specific user group is activated. However I'm not that hot at PHP and I can't figure out how I would check that the user being activated belongs to a given user group. Here's my basic code from in the main plugin file's init() function:

public function init() {
    craft()-&gt;on('users.onActivateUser', function(Event $event) {
        // check the user being activated belongs to the user group 'artist'
        // ???

        // now save an entry on their behalf
        $entry = new EntryModel();
        ...

        $success = craft()-&gt;entries-&gt;saveEntry($entry);

        if (!$success)
        {
            Craft::log('Couldn’t save the entry "'.$entry-&gt;title.'"', LogLevel::Error);
        }
    }
}
Within the context of that event, you will have access to:

$event-&gt;params['user']


... which is:


  A UserModel instance representing the user that has just been activated.


Once you've got your user model, you can do something like this:

$event-&gt;params['user']-&gt;isInGroup('artists')




On a separate note, I believe the correct syntax is:

craft()-&gt;on('users.activateUser' ...


You can ditch the "on" in onActivateUser. Check out the official example...