Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • higgsy 65 posts 92 karma points
    Mar 09, 2016 @ 22:56

    Is there a replacement for Member.BeforeAddGroup


    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

  • Mark 255 posts 612 karma points
    Mar 17, 2016 @ 11:37

    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

Please Sign in or register to post replies

Write your reply to: