Copied to clipboard

Flag this post as spam?

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


  • Lander Debeuf 23 posts 125 karma points
    Oct 15, 2019 @ 07:50
    Lander Debeuf
    0

    In Umbraco v8.1.5

    Whatever i seem to try it doesn't work to find a Member's email address

    I have created 2 MemberTypes "Owner" and "Student" each containing their respective fields, i am also using ModelsBuilder

    i have a list with all the members the list contains IPublishedContent types or i just take the currentuser

    var member = Umbraco.MembershipHelper.GetCurrentMember();
    

    This retrieved member (when logged in) is of a ....DOMAIN.Models.Owner

    In umbraco on the Members tab i can add a Login and an Email address but somehow i don't seem to be able to retrieve this in the backend.

    i've tried several method's

    var mail = member.Email;
    

    but the property is not existing on the member type.

    var mail = member.GetProperty("Email").Value<string>();
    

    this is returning an empty string

    var mailProperty = member.GetProperty("Email");
    var mailText = mailProperty.Value<string>();
    

    The property is found, but its value seems an empty string.

    What is the proper way to retrieve the Member's core properties?

  • Lander Debeuf 23 posts 125 karma points
    Oct 15, 2019 @ 14:45
    Lander Debeuf
    0

    This is fixed since update v8.2.0

    due to a bug in the backend before this version

    problem description

  • Ulf Möllerström 69 posts 246 karma points
    Jul 28, 2020 @ 18:54
    Ulf Möllerström
    1

    I'd really like to have the Models Builder to include the email-property on the generated member class...

Please Sign in or register to post replies

Write your reply to:

Draft