public async Task <IActionResult> logout(string returnUrl = null) { await _signInManager.SignOutAsync(); _logger.LogInformation("User logged out."); AlertMessageCollection.AddSuccessAlert($"You have successfully signed out of {WebSiteOptions.WebSiteTitle}."); return(RedirectToLocal(returnUrl)); }
public async Task <IActionResult> testemail(TestEmailModel model) { if (ModelState.IsValid) { var result = await _emailService.SendEmailAsync(new EmailMessage { EmailAddress = model.Email, Subject = $"Test message from {WebSiteOptions.WebSiteTitle}", Body = $"This is a test message from {WebSiteOptions.WebSiteTitle}.{Environment.NewLine}{Environment.NewLine}{model.Message}" }); if (result.Success) { AlertMessageCollection.AddSuccessAlert($"Email sent to {model.Email}\n{result.Details}", "Email Sent!"); } else { AlertMessageCollection.AddDangerAlert(result.Details, "Email Failure"); } } return(View()); }