Hi
I'm trying to do that same as in post
https://doc.dynamicweb.com/forum/templates/templates/set-password-email-using-marketing
sending a mail with a link to reset password,
but not from marketing from "Send user details" under a user
Using the "Send recovery mail" gives me the same issue
from the marketing post
if (Pageview != null && Pageview.Context != null) { var user = Pageview.Context.GetValue("User") as User; if (user != null) { string token = System.Guid.NewGuid().ToString(); string resetLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetPageIdByNavigationTag("SignInPage")) + "?Username=" + user.UserName + "&RecoveryToken=" + token; // Set the token on the user user.PasswordRecoveryTokenExpirationTime = System.DateTime.UtcNow.AddHours(Dynamicweb.Configuration.SystemConfiguration.Instance.GetInt32("/Globalsettings/Modules/UserManagement/ExtranetPasswordSecurity/RecoveryTokenTimeout")); user.PasswordRecoveryToken = token; user.Save(); } }
I can make a token, and build the link
int SignInPage = 6502; var primaryDomain = currentArea.DomainLock; string token = System.Guid.NewGuid().ToString(); string resetLink = "https//" + primaryDomain + Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(SignInPage) + "?Username=" + GetString("DWUsers:User:Username") + "&RecoveryToken=" + token;
but that is without having the "user" variable defined
How do I "Set the token on the user"?
or how do i define the user?
it is not a Pageview or a Pageview.Context
Non of these work
var user = GetValue("DWUsers:User:User") as User;
var user = GetValue("DWUsers:User") as User;
var user = GetValue("DWUsers") as User;
/ Thomas