diff --git a/app/notifications/validators.py b/app/notifications/validators.py index 6595bb4f6b..5ab1d149b7 100644 --- a/app/notifications/validators.py +++ b/app/notifications/validators.py @@ -203,7 +203,7 @@ def check_email_annual_limit(service: Service, requested_emails=0): current_app.logger.info( f"Service {service.id} reached their annual email limit of {service.email_annual_limit} when sending {requested_emails} messages. Sending reached annual limit email." ) - # TODO Send reached limit email + send_annual_limit_reached_email(service, "email", current_fiscal_year + 1) # Will this send put annual usage within 80% of the limit? if is_near_annual_limit and not annual_limit_client.check_has_warning_been_sent(service.id, EMAIL_TYPE): @@ -211,7 +211,7 @@ def check_email_annual_limit(service: Service, requested_emails=0): current_app.logger.info( f"Service {service.id} reached 80% of their annual email limit of {service.email_annual_limit} messages. Sending annual limit usage warning email." ) - # TODO: Send warning email + send_near_annual_limit_warning_email(service, "email", int(emails_sent_today + emails_sent_this_fiscal), current_fiscal_year + 1) return @@ -255,7 +255,7 @@ def check_sms_annual_limit(service: Service, requested_sms=0): current_app.logger.info( f"Service {service.id} reached their annual SMS limit of {service.sms_annual_limit} messages. Sending reached annual limit email." ) - # TODO Send reached limit email + send_annual_limit_reached_email(service, "email", current_fiscal_year + 1) # Will this send put annual usage within 80% of the limit? if is_near_annual_limit and not annual_limit_client.check_has_warning_been_sent(service.id, EMAIL_TYPE): @@ -263,7 +263,7 @@ def check_sms_annual_limit(service: Service, requested_sms=0): current_app.logger.info( f"Service {service.id} reached 80% of their annual SMS limit of {service.sms_annual_limit} messages. Sending annual limit usage warning email." ) - # TODO: Send warning email + send_near_annual_limit_warning_email(service, "email", int(sms_sent_today + sms_sent_this_fiscal), current_fiscal_year + 1) return