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 lettermint import Lettermint, ValidationError
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from joserfc import jwt, jwk, errors
|
from joserfc import jwt, jwk, errors
|
||||||
|
|
@ -52,8 +54,6 @@ async def send_email(recipient: str, subject: str, body: str):
|
||||||
.text(body)
|
.text(body)
|
||||||
.send()
|
.send()
|
||||||
)
|
)
|
||||||
|
logging.info("Email sent to {} with subject {} (Status: {})".format(recipient, subject, response.status_code))
|
||||||
print(response.status_code)
|
except ValidationError as e:
|
||||||
except ValidationError:
|
logging.exception(e)
|
||||||
# Error thrown if domain not approved for project
|
|
||||||
print("Lettermint validation error")
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue