public async Task <TaskResult> SendForTaskResult(TaskResult result, MessageData data) { if (!result.Success) { return(result); } var url = data.GetEndpointUrl(emailConfiguration.UrlBase); var message = EmailGenerator.GenerateMessage(data.Recipient, data.Type, url); try { await SendEmail(message); return(result); } catch (Exception e) { Console.WriteLine(e.ToString()); return(new TaskResult(new[] { "Failed to send email" })); } }