I changed my
IYafUserProfile.cs and YafUserProfile.cs
public string Prefix
{
get
{
return base["Prefix"] as string;
}
set
{
base["Prefix"] = value;
}
}
[SettingsAllowAnonymous(false)]
[CustomProviderData("FirstName;nvarchar;50")]
public string FirstName
{
get
{
return base["FirstName"] as string;
}
set
{
base["FirstName"] = value;
}
}
string Prefix { get; set; }
string FirstName { get; set; }
I have more properties...
Let me explain the problem now.
In my Database table yaf_prov_Profile has all new properties and Prefix too.
table yaf_User has only Prefix. why ??
The problem i am facing which might be cause by the above is..
In my Approve.aspx
I am calling SendRegistrationNotificationEmail
private void SendRegistrationNotificationEmail([NotNull] MembershipUser user)
{
// setup/save the profile
YafUserProfile userProfile = YafUserProfile.GetProfile(User.UserName);
string[] emails = this.Get().NotificationOnUserRegisterEmailList.Split(';');
var notifyAdmin = new YafTemplateEmail();
string subject =
this.GetText("COMMON", "NOTIFICATION_ON_USER_REGISTER_EMAIL_SUBJECT").FormatWith(
this.Get().Name);
notifyAdmin.TemplateParams["{adminlink}"] = YafBuildLink.GetLinkNotEscaped(ForumPages.admin_admin, true);
notifyAdmin.TemplateParams["{prefix}"] = userProfile.Prefix;
notifyAdmin.TemplateParams["{firstname}"] = userProfile.FirstName;
notifyAdmin.TemplateParams["{lastname}"] = userProfile.Lastname;
notifyAdmin.TemplateParams["{title}"] = userProfile.Title;
notifyAdmin.TemplateParams["{org}"] = userProfile.Organizaton;
notifyAdmin.TemplateParams["{phone}"] = userProfile.Phone;
notifyAdmin.TemplateParams["{email}"] = user.Email;
notifyAdmin.TemplateParams["{city}"] = userProfile.City;
notifyAdmin.TemplateParams["{state}"] = userProfile.State;
// notifyAdmin.TemplateParams["{Number}"] = userProfile.Phone;
notifyAdmin.TemplateParams["{forumname}"] = this.Get().Name;
string emailBody = notifyAdmin.ProcessTemplate("NOTIFICATION_ON_USER_REGISTER");
foreach (string email in emails.Where(email => email.Trim().IsSet()))
{
this.Get().Queue(this.Get().ForumEmail, email.Trim(), subject, emailBody);
}
}
I am geting all the values from user object.
But for userProfile object only prefix has its value others null.