Versions in this module Expand all Collapse all v1 v1.1.0 Jul 10, 2026 v1.0.0 Jul 6, 2026 Changes in this version + func RenderBody(spec TemplateSpec, channel Channel, body string, vars map[string]any) (string, error) + func ValidateBody(spec TemplateSpec, body string) error + type Channel string + const ChannelEmail + const ChannelInApp + const ChannelPush + const ChannelSMS + const ChannelWhatsApp + type ChannelDest struct + Channel Channel + Destination string + type ChannelSender interface + Send func(ctx context.Context, d Delivery) (providerMessageID string, err error) + type Delivery struct + Attempts int + Channel Channel + Destination string + ID uuid.UUID + LastError string + NotificationID uuid.UUID + ProviderMsgID string + Status string + TenantID uuid.UUID + type DeliveryReceipt struct + Attempts int + Channel Channel + CreatedAt time.Time + Destination string + ID uuid.UUID + LastError string + ProviderMsgID string + Status string + UpdatedAt *time.Time + type FakeSender struct + Deliveries []Delivery + Err error + func (f *FakeSender) Count() int + func (f *FakeSender) Reset() + func (f *FakeSender) Send(_ context.Context, d Delivery) (string, error) + type Importance string + const ImportanceImportant + const ImportanceLegal + const ImportanceNormal + type Message struct + Channels []ChannelDest + Importance Importance + Locale string + RecipientPartyID uuid.UUID + Resource resource.Ref + TemplateKey string + Variables map[string]any + type Notification struct + CreatedAt time.Time + CreatedBy uuid.UUID + ID uuid.UUID + Importance Importance + RecipientPartyID uuid.UUID + ResourceID *uuid.UUID + ResourceType *string + Status string + TemplateKey string + TenantID uuid.UUID + Variables map[string]any + type Option func(*Service) + func WithTracer(tr observability.Tracer) Option + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Err() error + func (r *Registry) Get(key string) (TemplateSpec, bool) + func (r *Registry) Keys() []string + func (r *Registry) Register(module string, spec TemplateSpec) + type Service struct + func New(reg *Registry, idgen model.IDGen, opts ...Option) *Service + func (s *Service) Deliveries(ctx context.Context, db database.TenantDB, notificationID uuid.UUID) ([]DeliveryReceipt, error) + func (s *Service) ListForParty(ctx context.Context, db database.TenantDB, partyID uuid.UUID) ([]Notification, error) + func (s *Service) RegisterSender(channel Channel, sender ChannelSender) + func (s *Service) Send(ctx context.Context, db database.TenantDB, msg Message) (uuid.UUID, error) + func (s *Service) SendPending(ctx context.Context, plat database.TxManager, tenantID uuid.UUID, ...) (int, error) + func (s *Service) SetChannelPref(ctx context.Context, db database.TenantDB, partyID uuid.UUID, channel Channel, ...) error + type TemplateSpec struct + Channels []string + Key string + Vars []string