This commit is contained in:
@@ -21,6 +21,24 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
public async Task SendEmailAsync(string email, string subject, string body, AyaNova.Models.GlobalOpsNotificationSettings smtpSettings, string attachPDFPath = null, string forceFileName = null, string htmlBody = null)
|
public async Task SendEmailAsync(string email, string subject, string body, AyaNova.Models.GlobalOpsNotificationSettings smtpSettings, string attachPDFPath = null, string forceFileName = null, string htmlBody = null)
|
||||||
{
|
{
|
||||||
|
#if (DEBUG)
|
||||||
|
//SAFETY BREAK FOR TESTING IN HOUSE
|
||||||
|
switch (email)
|
||||||
|
{
|
||||||
|
case "support@ayanova.com":
|
||||||
|
case "johncrdnl@gmail.com":
|
||||||
|
case "gzmailadmin@gmail.com":
|
||||||
|
case "sales@ayanova.com":
|
||||||
|
case "support@onayanova.com":
|
||||||
|
case "techworks@shaw.ca":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
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
|
||||||
|
System.Diagnostics.Debugger.Break();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var message = new MimeMessage();
|
var message = new MimeMessage();
|
||||||
@@ -72,6 +90,8 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
|
|
||||||
await client.AuthenticateAsync(smtpSettings.SmtpAccount, smtpSettings.SmtpPassword);
|
await client.AuthenticateAsync(smtpSettings.SmtpAccount, smtpSettings.SmtpPassword);
|
||||||
|
//this is the one and only place that email is sent from ultimately
|
||||||
|
//everything else is upstream
|
||||||
await client.SendAsync(message);
|
await client.SendAsync(message);
|
||||||
await client.DisconnectAsync(true);
|
await client.DisconnectAsync(true);
|
||||||
DisposeStreamsInMimeMessage(message);
|
DisposeStreamsInMimeMessage(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user