From 796ae48120c6cca60db409a5beb7a8ed3c989110 Mon Sep 17 00:00:00 2001 From: logerzerox Date: Thu, 9 Jan 2025 13:55:40 +0800 Subject: [PATCH] +fixes --- py/core/providers/auth/r2r_auth.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/py/core/providers/auth/r2r_auth.py b/py/core/providers/auth/r2r_auth.py index f891ac690..29bc0b1fe 100644 --- a/py/core/providers/auth/r2r_auth.py +++ b/py/core/providers/auth/r2r_auth.py @@ -290,9 +290,9 @@ async def send_verification_email( ) await self.email_provider.send_verification_email( - email=user.email, - verification_code=verification_code, - template_data={"first_name": first_name} + to_email=user.email, + verification_code=verification_code, + dynamic_template_data={"first_name": first_name} ) return verification_code, expiry @@ -422,8 +422,8 @@ async def change_password( ) try: await self.email_provider.send_password_changed_email( - email=user.email, - template_data={"first_name": user.name.split(" ")[0] or 'User'} + to_email=user.email, + dynamic_template_data={"first_name": user.name.split(" ")[0] or 'User'} ) except Exception as e: logger.error(f"Failed to send password change notification: {str(e)}") @@ -450,7 +450,9 @@ async def request_password_reset(self, email: str) -> dict[str, str]: user.name.split(" ")[0] if user.name else email.split("@")[0] ) await self.email_provider.send_password_reset_email( - email, reset_token, {"first_name": first_name} + to_email=email, + reset_token=reset_token, + dynamic_template_data={"first_name": first_name} ) return { @@ -493,8 +495,8 @@ async def confirm_password_reset( try: await self.email_provider.send_password_changed_email( - email=user.email, - template_data={"first_name": user.name.split(" ")[0] or 'User'} + to_email=user.email, + dynamic_template_data={"first_name": user.name.split(" ")[0] or 'User'} ) except Exception as e: logger.error(f"Failed to send password change notification: {str(e)}")