Skip to content

Commit

Permalink
Added emails
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbahrai committed Dec 2, 2024
1 parent 8ad076b commit f8e35b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/notifications/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ 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):
annual_limit_client.set_nearing_email_limit(service.id)
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

Expand Down Expand Up @@ -255,15 +255,15 @@ 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):
annual_limit_client.set_nearing_email_limit(service.id)
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

Expand Down

0 comments on commit f8e35b1

Please sign in to comment.