MailglassInbound.PubSub.Topics (MailglassInbound v0.2.0)

Copy Markdown View Source

Typed topic builder for mailglass_inbound PubSub broadcasts (TELE-07, D-45-07).

Mirrors Mailglass.PubSub.Topics in the core library: every topic is prefixed mailglass: so Phase 6 LINT-06 PrefixedPubSubTopics enforces the namespace at lint time. Broadcasts always go through this builder (never a literal topic string at the call site) — that is what keeps PrefixedPubSubTopics, which only flags literal string arguments, satisfied while still routing every inbound fan-out through one auditable surface.

Topics emitted

  • inbound_record_inserted/1"mailglass:inbound:#{tenant_id}" — the per-tenant stream that fires once after an InboundRecord is committed (status :inserted). The Phase 48 admin LiveView subscribes here on Mailglass.PubSub so it can render new inbound mail in real time without an inbound→admin compile dependency. The topic carries tenant_id so a subscriber only ever sees its own tenant's records.

Payloads broadcast on this topic are PII-free by contract (record id + provider + record_type only) — see MailglassInbound.Ingress.Plug.

Summary

Functions

Returns the per-tenant inbound record-inserted stream topic.

Functions

inbound_record_inserted(tenant_id)

(since 0.2.0)
@spec inbound_record_inserted(String.t()) :: String.t()

Returns the per-tenant inbound record-inserted stream topic.

The Phase 48 admin LiveView subscribes to this topic on Mailglass.PubSub. The tenant_id is embedded so subscribers are scoped to a single tenant.