mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
If resend not enabled, don't send the welcome email
This commit is contained in:
parent
d2f9c43c8e
commit
5d1dd3e2b7
1 changed files with 8 additions and 0 deletions
|
@ -20,10 +20,18 @@ if not RESEND_API_KEY:
|
|||
logger.info("RESEND_API_KEY not set - email sending disabled")
|
||||
|
||||
|
||||
def is_resend_enabled():
|
||||
return bool(RESEND_API_KEY)
|
||||
|
||||
|
||||
resend.api_key = RESEND_API_KEY
|
||||
|
||||
|
||||
async def send_welcome_email(name, email):
|
||||
if not is_resend_enabled():
|
||||
logger.debug("Email sending disabled")
|
||||
return
|
||||
|
||||
template = env.get_template("welcome.html")
|
||||
|
||||
html_content = template.render(name=name if not is_none_or_empty(name) else "you")
|
||||
|
|
Loading…
Add table
Reference in a new issue