24 lines
909 B
Python
24 lines
909 B
Python
import logging
|
|
|
|
from app.config.settings import settings
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class EmailService:
|
|
async def send_verification_email(self, email: str, token: str) -> None:
|
|
verify_link = f"{settings.frontend_base_url}/verify-email?token={token}"
|
|
subject = "Verify your BenyaMessenger account"
|
|
body = f"Open this link to verify your account: {verify_link}"
|
|
logger.info("EMAIL to=%s subject=%s body=%s", email, subject, body)
|
|
|
|
async def send_password_reset_email(self, email: str, token: str) -> None:
|
|
reset_link = f"{settings.frontend_base_url}/reset-password?token={token}"
|
|
subject = "Reset your BenyaMessenger password"
|
|
body = f"Open this link to reset your password: {reset_link}"
|
|
logger.info("EMAIL to=%s subject=%s body=%s", email, subject, body)
|
|
|
|
|
|
def get_email_service() -> EmailService:
|
|
return EmailService()
|