mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01: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:
parent
26ca3df605
commit
1d512b4986
1 changed files with 6 additions and 1 deletions
|
@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue