forked from sr2/cloud-api
feat(utils): use logging around email send
This commit is contained in:
parent
11eeddb347
commit
53b42b24dd
1 changed files with 5 additions and 5 deletions
10
src/utils.py
10
src/utils.py
|
|
@ -1,3 +1,5 @@
|
|||
import logging
|
||||
|
||||
from lettermint import Lettermint, ValidationError
|
||||
from datetime import datetime, timezone
|
||||
from joserfc import jwt, jwk, errors
|
||||
|
|
@ -52,8 +54,6 @@ async def send_email(recipient: str, subject: str, body: str):
|
|||
.text(body)
|
||||
.send()
|
||||
)
|
||||
|
||||
print(response.status_code)
|
||||
except ValidationError:
|
||||
# Error thrown if domain not approved for project
|
||||
print("Lettermint validation error")
|
||||
logging.info("Email sent to {} with subject {} (Status: {})".format(recipient, subject, response.status_code))
|
||||
except ValidationError as e:
|
||||
logging.exception(e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue