In a project that I'm upgrading from 4.11 to 7.3.8 we have some code that hooks into the Member.BeforeAddGroup and Member.AfterAddGroup. Basically, in the Before the code checks whether the Member is in a particular group, and then in the After it does the same check. If the code detects that the Member wasnt in that group in the Before event, but WAS in that group in the After event, then they have just been added to a particular group (in our case "TradeCustomers") and then we fire an email off to them. The businesslogic.Member object has obviously now been obsoleted, so im refactoring our codebase, however the new Umbraco.Core.Models.Member doesnt contain an equivalent BeforeAddGroup/AfterAddGroup method, nor does the MemberService or the MembershipHelper.
The Umbraco.Core.Models.Member object does raise events for Saving/Saved etc, however the problem with this is that the Member is not added to the group until after the Member has been saved - so hooking into either of these events is of no help either.
Does anyone have any thoughts on how I might replace such functionality?
Is there a replacement for Member.BeforeAddGroup
Hi,
In a project that I'm upgrading from 4.11 to 7.3.8 we have some code that hooks into the Member.BeforeAddGroup and Member.AfterAddGroup. Basically, in the Before the code checks whether the Member is in a particular group, and then in the After it does the same check. If the code detects that the Member wasnt in that group in the Before event, but WAS in that group in the After event, then they have just been added to a particular group (in our case "TradeCustomers") and then we fire an email off to them. The businesslogic.Member object has obviously now been obsoleted, so im refactoring our codebase, however the new Umbraco.Core.Models.Member doesnt contain an equivalent BeforeAddGroup/AfterAddGroup method, nor does the MemberService or the MembershipHelper.
The Umbraco.Core.Models.Member object does raise events for Saving/Saved etc, however the problem with this is that the Member is not added to the group until after the Member has been saved - so hooking into either of these events is of no help either.
Does anyone have any thoughts on how I might replace such functionality?
Thanks in advance Al
Hi @higgsy
Did you find out a solution for this? We do the very same thing for one of our sites that we're upgrading, and was wondering if there is a solution.
Thanks, Mark
is working on a reply...