I would like to perform an action when a member is added to a group from the back office. Great - there are events I can hook into - namely Member.BeforeAddGroup and Member.AfterAddGroup as outlined here:
But how can I determine WHAT group the member is about to be (or has just been) added to? I need to take different actions according to the group. Do I need to use the 2 event handlers togehter in some way?
Add to use the 'Add Member To Group' events
I would like to perform an action when a member is added to a group from the back office. Great - there are events I can hook into - namely Member.BeforeAddGroup and Member.AfterAddGroup as outlined here:
http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events/overview-of-all-events
But how can I determine WHAT group the member is about to be (or has just been) added to? I need to take different actions according to the group. Do I need to use the 2 event handlers togehter in some way?
You should be able to use the GroupId-property of the AddGroupEventArgs?
Something like this:
void Member_BeforeAddGroup(object sender,AddGroupEventArgs e)
{
Int32 groupId = e.GroupId;
// Yada yada
}
is working on a reply...