This commit is contained in:
2023-02-22 17:27:29 +00:00
parent 2bd20a0203
commit 115af150db

View File

@@ -22,6 +22,7 @@ namespace Sockeye.Util
public async Task SendEmailAsync(string email, string subject, string body, Sockeye.Models.GlobalOpsNotificationSettings smtpSettings, string attachPDFPath = null, string forceFileName = null, string htmlBody = null) public async Task SendEmailAsync(string email, string subject, string body, Sockeye.Models.GlobalOpsNotificationSettings smtpSettings, string attachPDFPath = null, string forceFileName = null, string htmlBody = null)
{ {
#if (DEBUG) #if (DEBUG)
//SAFETY BREAK FOR TESTING IN HOUSE
switch (email) switch (email)
{ {
case "support@ayanova.com": case "support@ayanova.com":
@@ -32,7 +33,7 @@ namespace Sockeye.Util
case "techworks@shaw.ca": case "techworks@shaw.ca":
break; break;
default: default:
System.Diagnostics.Debug.WriteLine($"DANGER: about to email someone {email} outside our test network"); System.Diagnostics.Debug.WriteLine($"DANGER: in DEBUG mode but about to email someone {email} outside our test network");
//DANGER: about to email someone outside our test network //DANGER: about to email someone outside our test network
System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break();
break; break;
@@ -89,6 +90,8 @@ namespace Sockeye.Util
await client.AuthenticateAsync(smtpSettings.SmtpAccount, smtpSettings.SmtpPassword); await client.AuthenticateAsync(smtpSettings.SmtpAccount, smtpSettings.SmtpPassword);
//NOTE: this is the one and only place in all of sockeye/ayanova that will send an email
//everything else is upstream caller
await client.SendAsync(message); await client.SendAsync(message);
await client.DisconnectAsync(true); await client.DisconnectAsync(true);
DisposeStreamsInMimeMessage(message); DisposeStreamsInMimeMessage(message);