| ⬅️ Back | 🏠 Docs Root |
Central service for preparing and sending email notifications.
File: src/workers/notification_worker/services/notification_service.py
NotificationService ClassAccepts SMTP credentials, SendGrid API key, site URL, logo URL, and URL path templates for action links (confirm, cancel, reschedule, contact form).
Creates internally:
AsyncEmailClient — for SMTP sendingTemplateRenderer — for Jinja2 HTML renderingsend_notification(email, subject, template_name, data)Main entry point:
enrich_email_context(data) to build full template context.self.renderer.render(template_name, context).self.email_client.send_email(email, subject, html).enrich_email_context(data) -> dictEnriches raw appointment data with:
date and time from datetime stringsite_url, logo_urllink_confirm, link_cancel, link_reschedule, contact_form_urlget_sms_text(data) -> strGenerates a plain-text SMS confirmation message in German, with transliterated name.
get_absolute_logo_url() -> str | NoneResolves the logo URL to an absolute path. Falls back to a default static path.