Skip to content

src/dazzle_back/runtime/email_templates.py

Generated: 2026-03-30T04:38:47.137494+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Email Template System with Tracking.

Provides a template engine for emails with: - Variable substitution - Branded signatures and footers - Open tracking (pixel injection) - Click tracking (link rewriting)

Usage: template_engine = EmailTemplateEngine(ops_db, tracking_base_url="https://app.exam...

Key Exports

  • BrandConfig
  • EmailTemplate
  • RenderedEmail
  • EmailTrackingRecord
  • EmailTemplateEngine
  • create_email_tracking_routes
  • register_template
  • render
  • record_event
  • list_templates
  • track_open
  • track_click
  • replace_var
  • replace_conditional
  • rewrite_link

Dependencies

Imports

  • __future__.annotations
  • html
  • re
  • dataclasses.dataclass
  • dataclasses.field
  • datetime.UTC
  • datetime.datetime
  • typing.Any
  • urllib.parse.urlencode
  • uuid.uuid4
  • dazzle_back.runtime.ops_database.OpsDatabase
  • fastapi.APIRouter
  • fastapi.Query
  • fastapi.Request
  • fastapi.responses.RedirectResponse
  • fastapi.responses.Response

Event Interactions

None detected.

Invariants and Assumptions

  • Validates: Template not found: {template_name}

Tests

  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py
  • tests/unit/test_runtime_mcp_tools.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.