-
☆ A M B ☆
- 2,475 Posts
Again, you CAN add custom events, but only you would fire them (e.g. you can create custom events for your custom plugins/snippets to enable other developers to piggyback on them). The code that actually executes the beforeUserFormSave event etc. is all hard-coded into the MODX core.
Sean, maybe I'm misunderstanding you, but can't you just send the email in a plugin connected to OnUserAddToGroup? That will only fire when a user is successfully added to a group and the &group variable will tell you which group the user was added to.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
Quote from: BobRay at Jul 23, 2012, 12:35 AMSean, maybe I'm misunderstanding you, but can't you just send the email in a plugin connected to OnUserAddToGroup? That will only fire when a user is successfully added to a group and the &group variable will tell you which group the user was added to.
I don't see that event [OnUserAddToGroup] being triggered in any of the places where you could manage user groups...
in fact the only place where I see any group events firing is when you drag a user from one group to another in the access control tab:
[2012-07-23 11:30:47] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupBeforeSave
[2012-07-23 11:30:47] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupSave
[2012-07-23 11:30:47] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupBeforeSave
[2012-07-23 11:30:47] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupSave
[2012-07-23 11:30:47] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupBeforeSave
[2012-07-23 11:30:47] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupSave
even that does not help me as by dragging a user, you remove them from one group as you add them to another!
ARGH!
I think I need a step back from this for a bit...
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
Ouch, did you delete a message or two in this thread? Two of my replies have disappeared.
To repeat, I think you're out of luck until the team adds code to invoke the AddUser events unless, as I suggested in one of the missing replies, the user object is also saved when the user is added to a group.
I think what I would do in your situation, is to create a form to add a user to a group, either with FormIt or a CMP in the Manager and invoke OnUserAddToGroup in your own form-processing code after the modUserGroupMember object has been successfully created.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
I saw those posts, [no I didn't delete anything] - weird....
not sure what to do now.
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525