Files
web_django_template/site/directmail/channels/__init__.py
T
westfarnandCursor 787f0e48fb Populate the client website template with catalog feature flags.
Extract always-on public/portal/UTM plus optional email_sms, directmail, blog, payments, social, and social_ai so new client sites can be bootstrapped from this seed.

Refs #1
Refs #2

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 07:55:26 -05:00

22 lines
645 B
Python

"""Channel dispatch — postcard / direct mail."""
from dataclasses import dataclass
from contacts.models import Channel
from directmail.models import Message
from directmail.providers.postcard import get_postcard_provider
@dataclass
class ProviderResult:
provider: str
provider_id: str
def dispatch_message(message: Message) -> ProviderResult:
if message.channel == Channel.POSTCARD:
provider = get_postcard_provider()
result = provider.send_postcard(message)
return ProviderResult(provider=provider.name, provider_id=result.provider_id)
raise ValueError(f"Unsupported channel: {message.channel}")