Add logging for successful email sends.

This commit is contained in:
Jared Goodwin 2020-03-09 18:48:18 -07:00
parent 5ec872f74f
commit fead39724f
4 changed files with 4 additions and 3 deletions

View File

@ -859,7 +859,7 @@ namespace Remotely.Server.Services
catch { }
}
public void WriteEvent(Exception ex, string organizationID = null)
public void WriteEvent(Exception ex, string organizationID)
{
try
{

View File

@ -48,6 +48,7 @@ namespace Remotely.Server.Services
mailMessage.Body = htmlMessage;
mailMessage.ReplyToList.Add(new MailAddress(replyTo));
mailClient.Send(mailMessage);
DataService.WriteEvent($"Email successfully sent to {email}. Subject: \"{subject}\".", organizationID);
return Task.FromResult(true);
}
catch (Exception ex)

View File

@ -92,7 +92,7 @@ namespace Remotely.Server.Services
}
catch (Exception ex)
{
DataService.WriteEvent(ex);
DataService.WriteEvent(ex, null);
}
}

View File

@ -253,7 +253,7 @@ namespace Remotely.Server
}
catch (Exception ex)
{
dataService.WriteEvent(ex);
dataService.WriteEvent(ex, null);
}
dataService.SetAllDevicesNotOnline();
dataService.CleanupOldRecords();