Files
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

25 lines
759 B
Python

"""Channel dispatch — email / SMS."""
from dataclasses import dataclass
from contacts.models import Channel
from email_sms.models import Message
from email_sms.providers.email.smtp2go import send_email
from email_sms.providers.sms.smtp2go import send_sms
@dataclass
class ProviderResult:
provider: str
provider_id: str
def dispatch_message(message: Message) -> ProviderResult:
if message.channel == Channel.EMAIL:
result = send_email(message)
return ProviderResult(provider="smtp2go_email", provider_id=result)
if message.channel == Channel.SMS:
result = send_sms(message)
return ProviderResult(provider="smtp2go_sms", provider_id=result)
raise ValueError(f"Unsupported channel: {message.channel}")