protected void btnEM22_Click(object sender, EventArgs e) { BaseReply reply = ExactTargetService.InvokeEM22ForgotPassword(new InvokeEM22ForgotPasswordRequest { PreferredLanguage = new Guid(ddlLanguages.SelectedValue), PasswordResetLink = "www.google.com", ToEmail = tbxSubscriberEmail1.Text }); lblMessage.Text = reply.Message; }
protected void btnSubmit_Click(object sender, EventArgs e) { var email = txtEmailAddress.Text; try { //always show success message, even if we don't send the email //add ASP.Net validation MembershipManager membershipManager = new MembershipManager(); Member member; member = membershipManager.GetMember(email); if (member != null) { var passwordReset = Sitecore.Context.Database.GetItem(Constants.TemplateIDs.ForgotPasswordPage); var link = string.Format(Request.Url.Host + "{0}?guid={1}", passwordReset.GetUrl(), new ResetPasswordTicket(member.MemberId).ResetTicketID); BaseReply reply = ExactTargetService.InvokeEM22ForgotPassword(new InvokeEM22ForgotPasswordRequest { PreferredLanguage = member.PreferredLanguage, PasswordResetLink = link, ToEmail = email, RequestUrl = Request.Url }); if (reply.Successful) { } else { litErrorMessage.Text = context.ProblemText; throw new Exception("Issue sending email to: " + email); } } else { throw new Exception("User does not exist: " + email); } } catch (Exception ex) { Sitecore.Diagnostics.Log.Error("Forgot password error", ex, this); //uxView.ActiveViewIndex = 0; //litErrorMessage.Visible = true; //litErrorMessage.Text = DictionaryConstants.EmailException; } if (string.IsNullOrEmpty(litErrorMessage.Text)) { uxView.ActiveViewIndex = 1; litSuccessStory.Text = Model.SuccessMessage.Rendered.Replace("$email$", Server.HtmlEncode(email)); } }