first commit
This commit is contained in:
23
app/email/service.py
Normal file
23
app/email/service.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user