MainWindow: Delay email sending
Test / Run tests (push) Failing after 43s

This commit is contained in:
2026-08-11 18:22:12 +02:00
parent 07b197958d
commit c50e6deec9
3 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -57,9 +57,10 @@ namespace Elwig.Helpers {
public string? SmtpUsername = null;
public string? SmtpPassword = null;
public string? SmtpFrom = null;
public (string Host, int Port, string Mode, string Username, string Password, string From)? Smtp =>
public double SmtpWait = 0;
public (string Host, int Port, string Mode, string Username, string Password, string From, double Wait)? Smtp =>
SmtpHost == null || SmtpPort == null || SmtpMode == null || SmtpUsername == null || SmtpPassword == null || SmtpFrom == null ?
null : (SmtpHost, (int)SmtpPort, SmtpMode, SmtpUsername, SmtpPassword, SmtpFrom);
null : (SmtpHost, (int)SmtpPort, SmtpMode, SmtpUsername, SmtpPassword, SmtpFrom, SmtpWait);
public IList<ScaleConfig> Scales;
private readonly List<ScaleConfig> ScaleList = [];
@@ -92,6 +93,7 @@ namespace Elwig.Helpers {
SmtpUsername = config["smtp:username"];
SmtpPassword = config["smtp:password"];
SmtpFrom = config["smtp:from"];
SmtpWait = double.TryParse(config["smtp:wait"], out var res) ? res : 0;
var scales = config.AsEnumerable().Where(i => i.Key.StartsWith("scale.")).GroupBy(i => i.Key.Split(':')[0][6..]).Select(i => i.Key).Order();
ScaleList.Clear();
+1
View File
@@ -958,6 +958,7 @@ namespace Elwig.Windows {
m.EmailAddresses.OrderBy(a => a.Nr).Select(a => a.Address).ToArray(),
subject, docs.Select(d => d.Title).ToArray()
)]);
await Task.Delay((int)(App.Config.SmtpWait * 1000));
}
});
+1
View File
@@ -26,6 +26,7 @@ auto = true
;username = ""
;password = ""
;from = mail@wg.at
;wait = 0.5
;[scale.1]
;type = SysTec-IT