feat(notifications+admin): SMS (Kavenegar) + Email (SMTP) channels & templates
Build backend images / build content-svc (push) Failing after 56s
Build backend images / build file-svc (push) Failing after 47s
Build backend images / build gateway (push) Failing after 1m0s
Build backend images / build identity-svc (push) Failing after 56s
Build backend images / build notification-svc (push) Failing after 11s
Build backend images / build render-svc (push) Failing after 4m5s
Build backend images / build studio-svc (push) Failing after 56s

Backend (notification-svc):
- channel_config table (per-tenant Kavenegar + SMTP settings) + migration 18
- sender pkg: Kavenegar SMS client + SMTP mailer (STARTTLS / implicit TLS), stdlib only
- endpoints: GET/PUT /v1/channels[/:channel], POST /v1/sms/send, POST /v1/email/send
  (template + {{var}} rendering); deliveries logged
- seeded 3 Persian email templates: welcome / account_verification / promotion
- gateway routes /v1/{channels,sms,email}/* → notification

Admin UI:
- /admin/messaging: SMS + Email provider config cards, test-send, email template editor
- nav link + fa/en labels

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-02 17:32:54 +03:30
parent e3f025cd2d
commit 507ac7e6a4
12 changed files with 735 additions and 2 deletions
+7
View File
@@ -39,6 +39,7 @@ func main() {
notifH := handlers.NewNotificationHandler(store)
prefH := handlers.NewPreferenceHandler(store)
tplH := handlers.NewTemplateHandler(store)
chH := handlers.NewChannelHandler(store)
r := gin.Default()
@@ -86,6 +87,12 @@ func main() {
v1.GET("/notification-templates", auth, admin, tplH.List)
v1.PUT("/notification-templates", auth, admin, tplH.Upsert)
// ── Channels: SMS (Kavenegar) + Email (SMTP) config & send (admin) ────────
v1.GET("/channels", auth, admin, chH.ListConfigs)
v1.PUT("/channels/:channel", auth, admin, chH.UpsertConfig)
v1.POST("/sms/send", auth, admin, chH.SendSMS)
v1.POST("/email/send", auth, admin, chH.SendEmail)
// ── Internal: create notification (service-to-service) ───────────────────
v1.POST("/internal/notifications", serviceAuth, notifH.CreateInternal)