Data model
The sypnia_mail schema: domains, templates, e-mails, events, suppressions, webhooks and inbound.
| Table | Holds | Key columns |
|---|---|---|
domains | sending domains of a project | project_id, name, dkim_tokens, state, verified_at, warmup_day |
templates | a template | project_id, name, default_locale, published_version |
template_versions | each saved version | template_id, version, locale, subject, html, text, created_by |
emails | each e-mail | id, project_id, from, to, subject, template, tags (jsonb), status, scheduled_at, ses_message_id, idempotency_key, body_ref |
email_events | each event | email_id, type, at, detail (jsonb) |
suppressions | addresses not sent to | project_id, address (lower-cased), reason, source_email_id, created_at |
webhooks and webhook_deliveries | endpoints and each attempt | url, events[], secret_hash, paused_at; event_id, attempt, status |
inbound_rules and inbound_messages | rules and received messages | match, action, target; raw_ref, from, to, rule_id, verdicts |
keys | API and SMTP keys | project_id, name, scopes[], hash, last_used_at |
emails is partitioned by month; bodies (body_ref) are objects in storage, deleted at the end of the plan’s retention. suppressions has a unique index on (project_id, address) and is checked on every send.