Copied to clipboard

Flag this post as spam?

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


  • TheWolverine 6 posts 107 karma points
    Mar 13, 2018 @ 08:57
    TheWolverine
    0

    Make member email not required in backend

    I've created an intranet in Umbraco where the members are being added by an import. Not all members have an email address, so a lot of members are created without one. The problem is that the Umbraco backend requires an e-mail address. This makes it impossible for editors to update members manually (since the member won't save without an e-mail address). Also creating new members manually doesn't work for the same reason.

    There is no reason why email address should be required. The API doesn't require it and a Membership provider neither. I understand that things like password recovery won't work without an email address, but that's not a problem.

    So my question is: is it possible to make the email address in the backend optional in Umbraco 7? I found older forum posts with the same issue, but I'm hoping that things have changed in Umbraco 7.

    If there is no way, I was thinking if it is possible to capture events and do something there so it's possible to save the member (insert an temp email address when saving for instance?)

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Mar 13, 2018 @ 09:17
    Michaël Vanbrabandt
    101

    Hi TheWolverine,

    we also had the same issue.

    The way we solved this, is like your last suggestion, by adding a temp email address like for example [email protected].

    One thing that you have to do, in order to make this work, is by changing the following property on the MembershipProvider in your web.config file:

    requiresUniqueEmail="false"
    

    Hope this helps.

    /Michaël

  • TheWolverine 6 posts 107 karma points
    Mar 13, 2018 @ 09:24
    TheWolverine
    0

    Thanks, good to know that this approach works! I was wondering if I could take it a step further and do this:

    • Capture the MemberSave event and add a temp email address so the member saves correctly.
      • Capture the MemberSaved event and through the MemberService remove the temp address and save the member.

    Because the MemberService doesn't require an email address, it should work I reckon. The only downside is that members need to be saved twice, causing some overhead. I'll post back after I check this!

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Mar 13, 2018 @ 09:29
    Michaël Vanbrabandt
    0

    No problem!

    Glad I could give you my experience in this case.

    PRO TIP

    But why not leave the temp email address in there? Because when you delete this and then update the member in the Umbraco backoffice, your blocked!

    Because it will give you an error that the email address is required.

    Hope this helps!

    /Michaël

  • TheWolverine 6 posts 107 karma points
    Mar 13, 2018 @ 09:58
    TheWolverine
    0

    I had hoped that the Member Saving event would fire before validation, so I could add the temp email address in code, but unfortunately (and understandably) this is not the case. So I guess I'm stuck with adding temp addresses manually for each member that doesn't have an email address and needs to be saved through the back end.

    I still think it's weird that there is no way to make email address optional...

Please Sign in or register to post replies

Write your reply to:

Draft