diff --git a/Lombiq.Hosting.Tenants.EmailQuotaManagement/Services/QuotaManagingSmtpServiceDecorator.cs b/Lombiq.Hosting.Tenants.EmailQuotaManagement/Services/QuotaManagingSmtpServiceDecorator.cs index d34fcd8b..38ef761e 100644 --- a/Lombiq.Hosting.Tenants.EmailQuotaManagement/Services/QuotaManagingSmtpServiceDecorator.cs +++ b/Lombiq.Hosting.Tenants.EmailQuotaManagement/Services/QuotaManagingSmtpServiceDecorator.cs @@ -60,10 +60,10 @@ public async Task SendAsync(MailMessage message) return emailResult; } - private async Task SendAlertEmailIfNecessaryAsync(EmailQuota emailQuota) + private Task SendAlertEmailIfNecessaryAsync(EmailQuota emailQuota) { var currentUsagePercentage = emailQuota.CurrentUsagePercentage(_emailQuotaService.GetEmailQuotaPerMonth()); - if (!_emailQuotaService.ShouldSendReminderEmail(emailQuota, currentUsagePercentage)) return; + if (!_emailQuotaService.ShouldSendReminderEmail(emailQuota, currentUsagePercentage)) return Task.CompletedTask; if (currentUsagePercentage >= 100) { @@ -73,7 +73,7 @@ private async Task SendAlertEmailIfNecessaryAsync(EmailQuota emailQuota) "EmailQuotaExceededError", _emailQuotaSubjectService.GetExceededEmailSubject(), currentUsagePercentage); - return; + return Task.CompletedTask; } SendQuotaEmail( @@ -82,6 +82,7 @@ private async Task SendAlertEmailIfNecessaryAsync(EmailQuota emailQuota) $"EmailQuotaWarning", _emailQuotaSubjectService.GetWarningEmailSubject(currentUsagePercentage), currentUsagePercentage); + return Task.CompletedTask; } private void SendQuotaEmail(