public async Task ProcessAsync(byte[] messageData) { var stringMessage = Encoding.UTF8.GetString(messageData); var message = JsonConvert.DeserializeObject <SendEmailModel>(stringMessage); await _emailService.SendMailAsync(message); }
public async Task <IActionResult> Post(SendEmailModel model) { try { await _sendEmailService.SendMailAsync(model); } catch (Exception e) { return(BadRequest(e.Message + " | " + e.InnerException?.Message)); } return(NoContent()); }