
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.utils.http import urlsafe_base64_encode
from django.utils.encoding import force_bytes
# from account.models import User 
from utils.exception import ValidationError 
def send_password_reset_email(email):
    """
    Service function to handle sending a password reset email.
    :param email: The email address of the user requesting a password reset
    :return: None
    :raises ValidationError: If the user does not exist
    """
    # if User.objects.filter(email=email).exists():
    #     user = User.objects.get(email=email)
    #     uid = urlsafe_base64_encode(force_bytes(user.id))
    #     token = PasswordResetTokenGenerator().make_token(user)
    #     link = f'http://127.0.0.1:8000/account/reset/{uid}/{token}'
    #     body = f'Click the following link to reset your password: {link}'

    #     data = {
    #         'subject': 'Reset Your Password',
    #         'body': body,
    #         'to_email': user.email,
    #     }

        
    #     return
    # else:
    #     raise ValidationError('You are not a Registered User')
    pass