Skip to content

Commit

Permalink
LGA-2451 Added check to notifications client on send email
Browse files Browse the repository at this point in the history
  • Loading branch information
TawneeOwl committed May 22, 2023
1 parent 3d6dbc6 commit b954866
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cla_public/apps/base/govuk_notify/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def __init__(self):
raise ValueError("Missing API Key for GOVUK Notify")

def send_email(self, email_address, template_id, personalisation):
if not self.notifications_client:
log.info("No API key set, unable to send email")
return
try:
self.notifications_client.send_email_notification(
email_address=email_address, # required string
Expand Down

0 comments on commit b954866

Please sign in to comment.