YAFLogo

McHine
  • McHine
  • 72.4% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4.0.0 RC4
13 days ago
sorry watcha, but searching my code for 'email' and this forum for 'email' and variants hasn't thrown up what i'm looking for and 20 minutes later i know you'll be able to type it from memory.

how do i call a user's email address?

cheers!

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
13 days ago
from which user the current user or a specific user ?
McHine
  • McHine
  • 72.4% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4.0.0 RC4
12 days ago
current in this case, but if you could tell me specifc other that would help at some stage as well.

appreciated!

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
12 days ago
well if you want to get the email from the current is user then you can get it from the boardcontext there is the pageuser´

if (!BoardContext.Current.IsGuest)
{
    BoardContext.Current.PageUser.Email;
}

or if you want to get from a specific user by name

var email = await this.Get<IAspNetUsersHelper>().GetUserByNameAsync("username").Email;