Add debug tracing, email cleanup
This commit is contained in:
@@ -59,13 +59,12 @@ namespace LeafWeb.Web.Services
|
||||
leafInput.OutputFiles
|
||||
select Tuple.Create(outputFile, new MemoryStream(outputFile.Contents))).ToList();
|
||||
|
||||
var body = $"Your leaf analysis job, {leafInput.Identifier}, has completed." + Environment.NewLine;
|
||||
if (leafInput.OutputWarningMessage != null)
|
||||
body += "The following warning message was generated."
|
||||
+ Environment.NewLine + Environment.NewLine
|
||||
+ leafInput.OutputWarningMessage.Contents.GetString()
|
||||
+ Environment.NewLine;
|
||||
var body = $"Your leaf analysis job, {leafInput.Identifier}, has completed. ";
|
||||
|
||||
body += FormatWarningMessage(leafInput);
|
||||
|
||||
body += "Please see the attached results.";
|
||||
|
||||
var message = new MailMessage(_emaialFromAddress, leafInput.Email, "LeafWeb results", body);
|
||||
|
||||
try
|
||||
@@ -95,10 +94,24 @@ namespace LeafWeb.Web.Services
|
||||
+ errorMessage
|
||||
+ Environment.NewLine + Environment.NewLine
|
||||
+ "You will need to correct your input and resubmit.";
|
||||
|
||||
body += FormatWarningMessage(leafInput);
|
||||
|
||||
var message = new MailMessage(_emaialFromAddress, leafInput.Email, "LeafWeb processing error", body);
|
||||
SendMessage(message);
|
||||
}
|
||||
|
||||
private string FormatWarningMessage(LeafInput leafInput)
|
||||
{
|
||||
if (leafInput.OutputWarningMessage != null)
|
||||
return Environment.NewLine + Environment.NewLine
|
||||
+ "The following warning message was generated."
|
||||
+ Environment.NewLine + Environment.NewLine
|
||||
+ leafInput.OutputWarningMessage.Contents.GetString()
|
||||
+ Environment.NewLine;
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private void SendMessage(MailMessage mailMessage)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user