public async Task <IActionResult> MarkMessageAsClosed(int id) { var message = await _clientMessageRepository.GetAsync(id); message.IsClosed = true; message.DateClosed = DateTime.Now; await _clientMessageRepository.SaveAsync(); return(await LoadInbox()); }
public async Task <IActionResult> SendClientMessage(ContactFormViewModel contactFormViewModel) { var message = new ClientMessage { DateSent = DateTime.Now, DateClosed = null, Message = contactFormViewModel.Message, Email = contactFormViewModel.Email, Name = contactFormViewModel.Name }; await _clientMessageRepository.AddAysnc(message); await _clientMessageRepository.SaveAsync(); return(View("EmailSent", new EmailSentViewModel() { EmailAddress = "*****@*****.**", Message = "Your message has been sent the owners aim to respond within three working days." })); }