Refactored email handling
This commit is contained in:
@@ -45,8 +45,10 @@ public sealed class ProcessEmailEventHandler(IDbContextFactory<ApplicationDbCont
|
|||||||
|
|
||||||
if (outgoing?.Count == 0) return;
|
if (outgoing?.Count == 0) return;
|
||||||
|
|
||||||
if (emailService.Status is not (Domain.EmailStatuses.Connected or Domain.EmailStatuses.Success))
|
var connectResult = await emailService.ConnectAsync(cancellationToken);
|
||||||
await emailService.ConnectAsync(cancellationToken);
|
|
||||||
|
if(connectResult.IsFailed || connectResult.Value.Status is not (Domain.EmailStatuses.Connected or Domain.EmailStatuses.Success))
|
||||||
|
return;
|
||||||
|
|
||||||
var failedTransmissions = new List<(long notificationId, string? error)>();
|
var failedTransmissions = new List<(long notificationId, string? error)>();
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Email": {
|
"Email": {
|
||||||
"SmtpServer": "mail.litecharms.co.za",
|
"Host": "mail.litecharms.co.za",
|
||||||
"SmtpPort": 465,
|
"Port": 465,
|
||||||
|
"UseSsl": true,
|
||||||
|
"Credentials": {
|
||||||
|
"username": "pfm@litecharms.co.za"
|
||||||
|
},
|
||||||
"SenderEmail": "pfm@litecharms.co.za",
|
"SenderEmail": "pfm@litecharms.co.za",
|
||||||
"SenderName": "Post Fund Management Updates"
|
"SenderName": "Post Fund Management Updates"
|
||||||
},
|
},
|
||||||
|
|||||||
+2
-2
@@ -53,8 +53,8 @@ services:
|
|||||||
- Email__Credentials__Username=${EMAIL_CREDENTIALS_USERNAME:-}
|
- Email__Credentials__Username=${EMAIL_CREDENTIALS_USERNAME:-}
|
||||||
- Email__SenderEmail=${EMAIL_SENDER_EMAIL:-pfm@litecharms.co.za}
|
- Email__SenderEmail=${EMAIL_SENDER_EMAIL:-pfm@litecharms.co.za}
|
||||||
- Email__SenderName=${EMAIL_SENDER_NAME:-Post Fund Management Updates}
|
- Email__SenderName=${EMAIL_SENDER_NAME:-Post Fund Management Updates}
|
||||||
- Email__SmtpServer=${EMAIL_SMTP_SERVER:-}
|
- Email__Host=${EMAIL_SMTP_SERVER:-}
|
||||||
- Email__SmtpPort=${EMAIL_SMTP_PORT:-465}
|
- Email__Port=${EMAIL_SMTP_PORT:-465}
|
||||||
|
|
||||||
# Redis overrides
|
# Redis overrides
|
||||||
- ConnectionStrings__Redis=${REDIS_CONNECTION_STRING:-192.168.1.171:6379,ssl=false,abortConnect=false}
|
- ConnectionStrings__Redis=${REDIS_CONNECTION_STRING:-192.168.1.171:6379,ssl=false,abortConnect=false}
|
||||||
|
|||||||
Reference in New Issue
Block a user