fix(tenancy): use absolute URL in team invitation email link
Some checks failed
Some checks failed
Email clients need absolute URLs to make links clickable. The acceptance_link was a relative path (/store/invitation/accept?token=...) which rendered as plain text. Now prepends the platform domain with the correct protocol. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -980,9 +980,13 @@ class StoreTeamService:
|
||||
role_name: str,
|
||||
):
|
||||
"""Send team invitation email."""
|
||||
from app.core.config import settings as app_settings
|
||||
from app.modules.messaging.services.email_service import EmailService
|
||||
|
||||
acceptance_link = f"/store/invitation/accept?token={token}"
|
||||
domain = app_settings.main_domain.rstrip("/")
|
||||
scheme = "http" if "localhost" in domain else "https"
|
||||
base_url = f"{scheme}://{domain}" if "://" not in domain else domain
|
||||
acceptance_link = f"{base_url}/store/invitation/accept?token={token}"
|
||||
|
||||
email_service = EmailService(db)
|
||||
email_service.send_template(
|
||||
|
||||
Reference in New Issue
Block a user