feat: Internationalize sent emails (#3818)

This commit is contained in:
Arsène Reymond
2024-07-20 12:32:24 +02:00
committed by GitHub
parent c205dff523
commit 60c33b499c
7 changed files with 78 additions and 31 deletions

View File

@@ -32,14 +32,14 @@ class PasswordResetService(BaseService):
return self.db.tokens_pw_reset.create(save_token)
def send_reset_email(self, email: str):
def send_reset_email(self, email: str, accept_language: str | None = None):
token_entry = self.generate_reset_token(email)
if token_entry is None:
return None
# Send Email
email_servive = EmailService()
email_servive = EmailService(locale=accept_language)
reset_url = f"{self.settings.BASE_URL}/reset-password/?token={token_entry.token}"
try: