mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Use environment variable to set sender email of auth link emails (#907)
Set sender email using `RESEND_EMAIL` environment variable for magic link sent via Resend API for authentication . It was previously hard-coded. This prevented hosting Khoj on other domains. Resolves #908
This commit is contained in:
@@ -44,7 +44,12 @@ async def send_magic_link_email(email, unique_id, host):
|
||||
html_content = template.render(link=f"{host}auth/magic?code={unique_id}")
|
||||
|
||||
resend.Emails.send(
|
||||
{"sender": "noreply@khoj.dev", "to": email, "subject": "Your Sign-In Link for Khoj 🚀", "html": html_content}
|
||||
{
|
||||
"sender": os.environ.get("RESEND_EMAIL", "noreply@khoj.dev"),
|
||||
"to": email,
|
||||
"subject": "Your Sign-In Link for Khoj 🚀",
|
||||
"html": html_content,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user