Example #1
0
        public async Task <IActionResult> OnPostAsync(CreateNewAccountRequest request, [FromServices] UserAccount.Module module)
        {
            var message = new CreateNewAccountMessage(request.Name, request.Email,
                                                      request.Password, request.PasswordConfirmation, request.TermsAccepted);

            await module.SendMessage(message);

            this.SendSuccessMessage($"Welcome to WEBills {request.Name}! Now you can login and enjoy.");

            return(this.RedirectToPage("/Login/Login"));
        }
Example #2
0
        public async Task <IActionResult> OnPostAsync(ForgotMyPasswordRequest request, [FromServices] UserAccount.Module module)
        {
            var message = new GenerateNewPasswordMessage(request.Email);
            await module.SendMessage(message);

            //await notificationService.Send(new Notification(
            //    new Notification.Sender("Admin", "*****@*****.**"),
            //    new Notification.Receiver(generatedPassword.UserName, generatedPassword.UserContact),
            //    "WEBills - Did you forget you password?",
            //    $"Hey <b> {generatedPassword.UserName} </b>, how are you?<br /> Here is your wew Password: <b> {generatedPassword.Password} </b>"));

            this.SendSuccessMessage("You will receive an e-mail with instructions to get you password back");

            return(this.RedirectToPage("/Login/Login"));
        }