More auditing.

This commit is contained in:
Michael 2017-05-18 15:35:47 -04:00
parent 35a0980d93
commit 0571a9c8d9

View file

@ -37,14 +37,15 @@ public Task SendAsync(IdentityMessage msg)
Subject = "[ShiftOS] " + msg.Subject,
BodyHtml = msg.Body,
Tracking = true,
FooterAddress = "sys@michaeltheshifter.me",
SignatureDomain = "getshiftos.ml"
};
var result = reachmail.Easysmtp.Post(request);
var sb = new StringBuilder();
sb.AppendLine("<strong>Email summary</strong>");
sb.AppendLine("Current volume: " + result.CurrentVolume.ToString());
if (result.Failures)
{
var sb = new StringBuilder();
sb.AppendLine("A fatal exception has occurred in the Unite mail backend.");
sb.AppendLine();
sb.AppendLine("Basically, we couldn't send messages to the following addresses: ");
@ -54,12 +55,13 @@ public Task SendAsync(IdentityMessage msg)
sb.AppendLine(" - " + addr.Email);
sb.AppendLine(" - Reason: " + addr.Reason);
}
sb.AppendLine("FUCKING CONTACT MICHAEL. NOW.");
string exc = sb.ToString();
var db = new ApplicationDbContext();
db.AuditLogs.Add(new AuditLog("system", AuditLogLevel.Admin, exc));
db.SaveChanges();
sb.AppendLine("I don't want to swear, but seriously. I need to fix this. - Michael");
}
string exc = sb.ToString();
var db = new ApplicationDbContext();
db.AuditLogs.Add(new AuditLog("system", AuditLogLevel.Admin, exc));
db.SaveChanges();
return Task.FromResult<DeliveryResponse>(result);
}