public async Task <IActionResult> Resend(int id) { var oldEmail = await _dbContext.OutboundEmails.GetEmailById(id); if (oldEmail == null || oldEmail.ReplacedByEmail != null) { return(View(nameof(View), EmailModel.GetModelFromOutboundEmail(oldEmail, User.IsInRole(Roles.ApplicationAdministrator), "Det gick inte att skicka om detta e-postmeddelande"))); } _notificationService.CreateReplacingEmail( oldEmail.Recipient, oldEmail.Subject, oldEmail.PlainBody, oldEmail.HtmlBody, oldEmail.NotificationType, oldEmail.OutboundEmailId, User.GetUserId() ); return(RedirectToAction(nameof(List))); }
public async Task <IActionResult> View(int id) { return(View(EmailModel.GetModelFromOutboundEmail(await _dbContext.OutboundEmails.GetEmailById(id), User.IsInRole(Roles.ApplicationAdministrator)))); }