Skip to content

Commit 7876a9c

Browse files
committed
Add a log when the email is sent, not only when it fails
1 parent 21cc2bc commit 7876a9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

virtual_labs/infrastructure/email/send_welcome_email.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ async def send_welcome_email(recipient: str) -> str:
1515
)
1616
fm = FastMail(email_config)
1717
await fm.send_message(message, template_name="welcome.html")
18+
logger.info(f"A welcome email has been sent to {recipient}")
1819
return f"email sent successfully to {recipient}"
1920
except Exception:
20-
logger.info(f"Unable to send a welcome email to {recipient}!")
21+
logger.warning(f"Unable to send a welcome email to {recipient}!")
2122
return f"email has not been sent to {recipient}"

0 commit comments

Comments
 (0)