Email delivery
Get the files immediately by secure download, with a copy by email.
DataData ModelSections
Data Model Designed
What the service keeps, how the pieces relate, and what every field means. The SQL is on the Schema tab.
Entities
Message
One email asked for, and whether it was sent.
Belongs to one user and one app, by ID and name.
delivery.messages
Processed event
A platform event already acted on.
Stands alone.
delivery.inbound_events
Life of each record
- Message
- `queued` → `sent`, or `failed` after the last retry, or `cancelled` if the account is deleted first.
Fields
delivery.messages
One row per email asked for. It records what was sent and whether it arrived at Resend; never the address or the content.
iduuid- The message's ID.
- Primary key. UUIDv7
owner_iduuid- The user it is for. A plain ID; the address is looked up at send time, never stored.
apptext- Which app asked.
- 1 to 50 characters, from the
appclaim of the delegated token referencetext- The app's label.
- 1 to 200 characters
idempotency_keytext- The key that stops a second send.
- 1 to 255 characters; unique per app
channeltextdefault 'email'- How it is sent. SMS and push arrive in MVP2.
emailin version 1templatetext- Which email.
order_paidin version 1statustextdefault 'queued'- Where the message is.
queued,sent,failedorcancelledattemptssmallintdefault 0- Sends tried: the first and up to 3 retries.
- 0 to 4
provider_message_idtextcan be empty- Resend's ID, to trace a message with Resend.
- Set exactly when sent
last_errortextcan be empty- The provider's reason, without any personal data.
- Set when failed
sent_attimestamptzcan be empty- When Resend accepted it.
- Set exactly when sent
created_attimestamptzdefault now()- When it was asked for.
delivery.inbound_events
One row per platform event Delivery has acted on.
event_iduuid- The event's ID.
- Primary key
typetext- What happened.
- 1 to 100 characters
created_attimestamptzdefault now()- When Delivery processed it.
The service template also gives Delivery audit_events, idempotency_keys and outbound_events.
Data model level: business rules the service guarantees
- An email is triggered only by a server-side event, never by a browser.
- The same event never sends two emails.
- No email ever contains a link straight to a file.
- Addresses are never stored in Delivery.
What is deliberately not stored
- Email addresses: looked up at send time.
- The email's content: rebuilt from the template if ever needed.
- File links: emails link to pages on 01scale.com, never to files.