Skip to content
Registry StackDocsv0.48.0

Registry Messaging overview

View as Markdown

Registry Messaging sends one message to one destination over one channel for an authorised caller. It renders the message from a reviewed template, hands it to a provider the operator configured, and reports what is known about delivery.

You define a package, and an operator defines a runtime file. A package is the reviewed configuration a deployment serves unchanged. Three of its parts carry most of the work:

  • A template renders the message from the data a request carries, in each locale it declares. It has a JSON Schema for that data, and it can carry a sample that messagingctl check renders.
  • A sender profile fixes a channel, email or SMS, to one provider and one sender identity. It says how a failed send is retried, how long a message may wait, and what happens when a send may have reached the provider.
  • An access profile names the OAuth clients it admits, the scopes their tokens carry, the sender profiles and templates a sender may use, and the rate limits that apply.

The package declares each provider’s type, smtp or http, and whether the provider deduplicates a repeated send. For an http provider it also holds the request scripts and says whether the provider reports delivery. The endpoint, credentials, and callback secret belong to the runtime file, together with the database, the token issuer, the audit journal, and retention.

A caller picks a sender profile and a template, and sends the recipient and the data. Messaging answers 202 once the message is queued. A caller that lost that answer sends the same body under the same Idempotency-Key. It gets the original answer back while Messaging keeps the receipt, 7 days by default, and never a second message. An access profile can also let a caller send its own content with no template (allowDirectContent).

Before it answers 202, Messaging resolves the caller’s access profile, checks the data against the template’s schema, renders every part, and stores the message with its recipient and rendered content. Nothing renders later, so a package change never alters a message already accepted.

A worker then sends it. The message carries two separate facts. Dispatch is what Messaging did, and submitted means the provider accepted the message. Report is what the provider said afterwards. status reads delivered only when the provider reported it.

Whether a message can reach delivered depends on the provider, not the channel. An http provider whose provider.yaml sets capabilities.receipts: callback posts reports that move the status on, for SMS or email. Any other provider reports nothing, so an email sent through SMTP stays submitted. A send that failed in a way a later attempt may overcome is retried with growing delays. It stops when it succeeds, runs out of attempts, or expires. A permanent refusal is not retried. The message status and the dispatch policy hold the states and the defaults.

Three parties own three different answers:

  • The caller’s source of record owns why and when to send, the recipient, and whether the person agreed to be contacted. Messaging decides none of them.
  • Messaging owns rendering, the queue, attempts, receipts, retention, and its audit journal.
  • The provider owns delivery. Messaging repeats what the provider reported and never more.

One state belongs to nobody yet. unknown means a send may have reached the provider and nobody can tell. Under the sender profile’s default onUncertain: hold, the worker sends nothing more until an operator who has asked the provider settles it.

Messaging is not a contact directory, a consent registry, or a scheduler. It holds no recipient beyond what a request carries. It erases rendered content and contact details when the retention period ends, counted from when the message finishes. A message still waiting or held as unknown keeps them.

Being allowed to act on a record elsewhere does not let a caller send. Every product reaches Messaging over its public HTTP contract, and Messaging’s own access profile decides. An authorisation the caller holds in another product does not carry over. Messaging never writes to another product’s database.

rstack dev runs a package, such as the starter, on your machine, with Mailpit to catch email and a mock SMS gateway that reports delivery.