Skip to content

feat(communications): unified CommunicationTemplate CRUD and orchestration#1508

Open
kkopanidis wants to merge 1 commit into
mainfrom
feat/communications-unified-templates
Open

feat(communications): unified CommunicationTemplate CRUD and orchestration#1508
kkopanidis wants to merge 1 commit into
mainfrom
feat/communications-unified-templates

Conversation

@kkopanidis

Copy link
Copy Markdown
Contributor

Problem

Unified CommunicationTemplate documents existed in schema and GitOps export, but operators could not manage them via Admin API or gRPC, and templateName on orchestrated sends was ignored. Email-only templates and multi-channel sends could not share a single resolution path.

Summary

  • CommunicationTemplateService with validation, Handlebars resolution, and email-template migration helper
  • Admin REST CRUD at /communications/templates plus templateName on /send/multiple, /send/fallback, and new /communications/send
  • gRPC CRUD RPCs and real RegisterCommunicationTemplate implementation
  • Orchestrator resolves CommunicationTemplate first, EmailTemplate fallback for email (preserves external-managed email path)
  • GitOps import validation and email-template name collision checks (priority 30 unchanged)
  • communication_templates_total metric and unified send counters on orchestrated paths
  • grpc-sdk client methods and optional templateName on send helpers

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other (please describe)

Does this PR introduce a breaking change?

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the main branch

Test plan

  • POST /communications/templates — create email+push template; verify variables auto-extracted
  • GET/PATCH/DELETE /communications/templates/:id — round-trip CRUD
  • POST /communications/send with templateName — single-channel send renders template content
  • POST /send/multiple with templateName — per-channel rendered content
  • Send with templateName matching only EmailTemplate — email still sends (external-managed path intact)
  • Create unified template with same name as existing EmailTemplate — expect ALREADY_EXISTS
  • GitOps import communicationTemplates record with invalid channel/content — record fails with descriptive error
  • POST /communications/templates/migrate-from-email with dryRun: true — returns planned documents
  • gRPC RegisterCommunicationTemplate + ListCommunicationTemplates return persisted JSON

…ation

Wire template resolution into orchestrated sends, admin REST and gRPC CRUD,
GitOps import validation, and grpc-sdk client methods so templateName resolves
CommunicationTemplate first with EmailTemplate email fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant