private async Task <Tuple <ResponseMessageDto, MessageQueue> > Action(MessageQueue messageQueue) { var employee = JsonConverter.ConvertFromJson <EmployeeDto>(messageQueue.SourceRawJson); // TODO: introduce a template var message = $"Happy birthday {employee.Name}, {employee.LastName}"; var sendEmail = await _sendEmailHelper.SendEmailAsync("*****@*****.**", message, "Birthday Wishes", true, false); if (sendEmail) { messageQueue.MessageStatus = MessageStatusEnum.Sent; return(new Tuple <ResponseMessageDto, MessageQueue>(new ResponseMessageDto { Success = true }, messageQueue)); } else { messageQueue.MessageStatus = MessageStatusEnum.Failed; return(new Tuple <ResponseMessageDto, MessageQueue>(new ResponseMessageDto { Success = false, Errors = new List <string> { "Email could not be sent" } }, messageQueue)); } }
private async Task <Tuple <ResponseMessageDto, MessageQueue> > Action(MessageQueue messageQueue) { var employee = JsonConverter.ConvertFromJson <EmployeeDto>(messageQueue.SourceRawJson); // TODO: introduce a template var message = $"Welcome to iOCO {employee.Name}, {employee.LastName}, we are so proud to have you on board"; var sendEmail = await _sendEmailHelper.SendEmailAsync("*****@*****.**", message, "Birthday Wishes", true, false); if (sendEmail) { return(new Tuple <ResponseMessageDto, MessageQueue>(new ResponseMessageDto { Success = true }, messageQueue)); } else { return(new Tuple <ResponseMessageDto, MessageQueue>(new ResponseMessageDto { Success = false, Errors = new List <string> { "Email could not be sent" } }, messageQueue)); } }