Copied to clipboard

Flag this post as spam?

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


  • Harshit 64 posts 226 karma points
    Jan 21, 2016 @ 10:13
    Harshit
    0

    how to get a member property using api in surface controller

    Hi,

    i am trying to fetch a member using email id , then its properties using GeProperties .

    Member.GetMemberFromEmal(email)
    

    This is obsolete now .can any body help which api does the same?

    Regards, Harshit

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Jan 21, 2016 @ 10:32
    Alex Skrypnyk
    100

    Hi Harshit,

    Try to use MemberService, read more here - https://our.umbraco.org/documentation/reference/management/services/memberservice

    Thanks,

    Alex

  • Harshit 64 posts 226 karma points
    Jan 21, 2016 @ 11:20
    Harshit
    0

    Thanks Alex :)

    any idea on member properties which can be used for updating/changing password?

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Jan 21, 2016 @ 11:23
    Alex Skrypnyk
    0

    You are welcome,

    You can set new password like that:

    ApplicationContext.Services.MemberService.SavePassword(member, Guid.NewGuid().ToString("d").Substring(1, 8));
    

    Thanks, Alex

  • Harshit 64 posts 226 karma points
    Jan 21, 2016 @ 11:37
    Harshit
    0

    I am using SurfaceController, so just wondering will ApplicationContext.Services work?

    Regards, Harshit

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Jan 21, 2016 @ 11:44
    Alex Skrypnyk
    1

    Yes,

            var member = Services.MemberService.GetByEmail(email);
            Services.MemberService.SavePassword(member, new Guid().ToString());
    
  • Harshit 64 posts 226 karma points
    Jan 21, 2016 @ 11:46
    Harshit
    0

    Thanks a lot Alex :) its really helpful.

    cheers

Please Sign in or register to post replies

Write your reply to:

Draft