Canais, tipos e opt-out granular por cliente.
Email (AWS SES), in-app, webhook. Templates HTML/texto por organização. NotificationPreference controla quais eventos cada billing account recebe.
Sistema

3
canais (email, in_app, webhook)
11+
tipos (NotificationType)
∞
templates customizáveis
Per BA
opt-out granular
Canais disponíveis
Email
Envio transacional via AWS SES. Templates HTML + texto editáveis. Variáveis dinâmicas (nome, valor, vencimento, link).
- AWS SES
- Templates HTML + texto
- Variáveis dinâmicas
In-App
Notificação dentro do portal/dashboard. Marcação read/unread. Útil para clientes B2B que acessam diariamente.
- Portal/dashboard
- Read/unread
- Foco B2B
Webhook
HTTP POST para endpoint do cliente. Permite integração com Slack, Discord, sistemas internos.
- HTTP POST
- Integração Slack/Discord
- Sistemas internos
Recursos da notificação
Templates Editáveis
EmailTemplate por organização. Editor HTML + texto. Variáveis substituídas no envio.
- {{customer_name}}, {{amount}}, {{due_date}}, {{link}}
- Override por tipo
- Default global como fallback
Layout Customizável
EmailLayout por Company. Logo, cores, header, footer. Aplicado em todos templates.
- Logo, cores, header, footer
- Por Company
- Aplicação consistente
NotificationPreference por Billing Account
Cliente controla quais eventos recebe e em qual canal.
- Toggle por tipo
- Opt-out de marketing mantendo transacionais
- Editável no portal
Status Detalhado
NotificationStatus: pending → sent → delivered → read. Failed registra failureReason.
- pending → sent → delivered → read
- failureReason em falha
- Tracking completo
Agendamento
scheduledFor permite envio futuro. Worker processa no momento certo.
- scheduledFor
- Envio futuro
- Worker dedicado
Retry em Falha
retryCount incrementado em cada tentativa. Email com bounce trackeado, webhook com backoff.
- retryCount
- Bounce trackeado
- Backoff em webhook
Histórico Completo
Toda notificação persistida em Notification model. Filtros por tipo, canal, status, período.
- Notification model
- Filtros completos
- Histórico permanente
Multi-idioma (i18n)
Cliente com locale recebe templates traduzidos. PT-BR e EN-US nativos.
- PT-BR e EN-US nativos
- Templates por locale
- Tradução automática
Enviar lembrete de cobrança via API
bash
curl -X POST https://api.billing.kobana.com.br/v1/invoices/2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f6a/send-reminder \
-H "Authorization: Bearer $KOBANA_TOKEN"