1
votes

I need to customize the create (and edit) member section do some extra things on saving the member.

Here are a few:

  • Auto generate a password for the user (not error out when saved without password/username)

  • Email credentials to user.

  • Fill in some fields programmatically after user has created or updated the member.

What's the best/proper way to override that method? Is there a way I can change the markup on the page?

I am fairly comfortable with .NET Membership and from what I have read Umbraco leverages that technology. I just need to know how to tap in to the Umbraco engine and change a few things on the create/update methods for the members page.

Any help would be greatly appreciated.

Thanks in advance.

1

1 Answers

0
votes

I've done something similar in one of my Umbraco installations. What I did was create a new class that inherits from umbraco.businesslogic.ApplicationBase, and override like this:

 public class UmbracoPublishingManager : ApplicationBase
    {
        public UmbracoPublishingManager()
        {
            Umbraco.Core.Services.MemberService.Created+= MemberService_Created;
        }

        void MemberService_Created(Umbraco.Core.Services.IMemberService sender, Umbraco.Core.Events.NewEventArgs<Umbraco.Core.Models.IMember> e)
        {
            // Do stuff (use the parameter e to access the member data you need)
        }
     }

MemberService.Created is triggered whenever a new member is created. You can also trigger on a number of other things such as "Saving", "Deleting", "Deleted", etc, depending on what you need.