Deliver notifications through SendGrid and Resend email drivers #36

Closed
opened 2026-09-12 12:20:25 +00:00 by tech · 0 comments
Owner

Goal

Implement an independent SXCHNGE notifications gRPC service with durable asynchronous email delivery through SendGrid and Resend.

Approach

Implemented backend/notifications using shared DBImp/query/patch/connection wrappers and shared messaging adapters selected from Sendico. The independent interface module owns interface/proto/v1/interface.proto; generated Go bindings are ignored and generated before validation. The service validates and renders parameters into immutable email snapshots, persists caller-scoped idempotency and an atomic outbox, and consumes NATS jobs through reliable.Transport/Subscription. Both email drivers implement the provider-neutral rendered-email contract and use DriverConfig.

Acceptance criteria

  • Authenticated Send/Get with persistent idempotency and caller isolation.
  • Parameter validation, HTML escaping, immutable rendered job snapshots and expiry.
  • Adapted SendGrid and new Resend selected through DriverConfig with environment-provided secrets.
  • Shared database and Sendico-derived shared messaging infrastructure; no feature-local NATS connections.
  • Durable jobs, bounded retries, explicit ambiguous-delivery status and lease recovery.
  • Protobuf source in an independent interface module; generated bindings excluded from commits.
  • Focused transport, provider, rendering and storage tests; make test and make lint-backend passed.
  • Source/client archives packaged and standalone Go client tested.
  • Configuration, provenance, operational limitations and PR documented.

Notes

Delivered in #37 on notifications-36. Stacked on BFF PR #35: merge #35 first, retarget #37 to main, then merge only when authorized. Email only; SMS/push/Telegram return UNIMPLEMENTED. No delivery-receipt claims; ambiguous sends require reconciliation. NATS replicas (1/3/5), retention and app/ops/hybrid provisioning are configurable; production drift is rejected. Caller services own recipient authorization and preferences. No live emails or optional security scans run. Archives are generated locally; no registry upload was performed. See backend/notifications/README.md, PROVENANCE.md and docs/implementation.md.

Completion follow-up: queued/retrying notifications now expire independently of bus availability. Added authenticated TLS gRPC → shared MongoDB → shared NATS → email-driver integration coverage and cancellation/provisioning checks. Commit 4b14649 is pushed to PR #37. make test, make lint-backend and interface packaging passed in an isolated clean checkout. Initial shared-workspace checks failed on concurrent auth/product dependency and formatting edits; those unrelated edits were preserved.

### Goal Implement an independent SXCHNGE notifications gRPC service with durable asynchronous email delivery through SendGrid and Resend. ### Approach Implemented backend/notifications using shared DBImp/query/patch/connection wrappers and shared messaging adapters selected from Sendico. The independent interface module owns interface/proto/v1/interface.proto; generated Go bindings are ignored and generated before validation. The service validates and renders parameters into immutable email snapshots, persists caller-scoped idempotency and an atomic outbox, and consumes NATS jobs through reliable.Transport/Subscription. Both email drivers implement the provider-neutral rendered-email contract and use DriverConfig. ### Acceptance criteria - [x] Authenticated Send/Get with persistent idempotency and caller isolation. - [x] Parameter validation, HTML escaping, immutable rendered job snapshots and expiry. - [x] Adapted SendGrid and new Resend selected through DriverConfig with environment-provided secrets. - [x] Shared database and Sendico-derived shared messaging infrastructure; no feature-local NATS connections. - [x] Durable jobs, bounded retries, explicit ambiguous-delivery status and lease recovery. - [x] Protobuf source in an independent interface module; generated bindings excluded from commits. - [x] Focused transport, provider, rendering and storage tests; make test and make lint-backend passed. - [x] Source/client archives packaged and standalone Go client tested. - [x] Configuration, provenance, operational limitations and PR documented. ### Notes Delivered in https://git.sendico.io/tech/sxchnge/pulls/37 on notifications-36. Stacked on BFF PR #35: merge #35 first, retarget #37 to main, then merge only when authorized. Email only; SMS/push/Telegram return UNIMPLEMENTED. No delivery-receipt claims; ambiguous sends require reconciliation. NATS replicas (1/3/5), retention and app/ops/hybrid provisioning are configurable; production drift is rejected. Caller services own recipient authorization and preferences. No live emails or optional security scans run. Archives are generated locally; no registry upload was performed. See backend/notifications/README.md, PROVENANCE.md and docs/implementation.md. Completion follow-up: queued/retrying notifications now expire independently of bus availability. Added authenticated TLS gRPC → shared MongoDB → shared NATS → email-driver integration coverage and cancellation/provisioning checks. Commit 4b14649 is pushed to PR #37. make test, make lint-backend and interface packaging passed in an isolated clean checkout. Initial shared-workspace checks failed on concurrent auth/product dependency and formatting edits; those unrelated edits were preserved.
tech added the backend label 2026-09-12 12:20:25 +00:00
tech self-assigned this 2026-09-12 12:20:25 +00:00
tech added this to the SXCHNGE project 2026-09-12 12:20:25 +00:00
tech added reference notifications-36 2026-09-12 12:20:38 +00:00
tech changed reference from notifications-36 to notifications-36 2026-09-12 12:42:34 +00:00
tech changed reference from notifications-36 to notifications-36 2026-09-12 12:53:41 +00:00
tech closed this issue 2026-09-12 17:45:01 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tech/sxchnge#36