mirror of
https://github.com/StanGirard/quivr.git
synced 2024-09-11 13:15:41 +03:00
feat(resend): added env variablers (#673)
* feat(resend): added env variablers * fix(resend): made optional
This commit is contained in:
parent
430ab54479
commit
f63136350b
@ -14,4 +14,5 @@ PRIVATE=False
|
||||
MODEL_PATH=./local_models/ggml-gpt4all-j-v1.3-groovy.bin
|
||||
|
||||
#RESEND
|
||||
RESEND_API_KEY=
|
||||
RESEND_API_KEY=<change-me>
|
||||
RESEND_EMAIL_ADDRESS=onboarding@resend.dev
|
||||
|
@ -1,10 +1,9 @@
|
||||
import os
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
import resend
|
||||
from logger import get_logger
|
||||
from models.settings import CommonsDep, common_dependencies
|
||||
from models.settings import BrainSettings, CommonsDep, common_dependencies
|
||||
from pydantic import BaseModel
|
||||
|
||||
logger = get_logger(__name__)
|
||||
@ -74,7 +73,8 @@ class BrainSubscription(BaseModel):
|
||||
return f"{base_url}?brain_subscription_invitation={self.brain_id}"
|
||||
|
||||
def resend_invitation_email(self):
|
||||
resend.api_key = os.getenv("RESEND_API_KEY")
|
||||
brains_settings = BrainSettings() # pyright: ignore reportPrivateUsage=none
|
||||
resend.api_key = brains_settings.resend_api_key
|
||||
|
||||
brain_url = self.get_brain_url()
|
||||
|
||||
@ -86,7 +86,7 @@ class BrainSubscription(BaseModel):
|
||||
try:
|
||||
r = resend.Emails.send(
|
||||
{
|
||||
"from": "onboarding@resend.dev",
|
||||
"from": brains_settings.resend_email_address,
|
||||
"to": self.email,
|
||||
"subject": "Quivr - Brain Shared With You",
|
||||
"html": html_body,
|
||||
|
@ -12,6 +12,8 @@ class BrainSettings(BaseSettings):
|
||||
anthropic_api_key: str
|
||||
supabase_url: str
|
||||
supabase_service_key: str
|
||||
resend_api_key: str = "null"
|
||||
resend_email_address: str = "onboarding@resend.dev"
|
||||
|
||||
|
||||
class LLMSettings(BaseSettings):
|
||||
|
Loading…
Reference in New Issue
Block a user