From a68492213fd488268f54987395b5d3a493159cef Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Fri, 3 Jul 2026 15:43:55 +0530 Subject: [PATCH] appview/state: start email digest dispatcher --- appview/state/state.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/appview/state/state.go b/appview/state/state.go index b30fb464..a864ad25 100644 --- a/appview/state/state.go +++ b/appview/state/state.go @@ -26,6 +26,7 @@ import ( "tangled.org/core/appview/models" "tangled.org/core/appview/notify" dbnotify "tangled.org/core/appview/notify/db" + emaildispatch "tangled.org/core/appview/notify/email" lognotify "tangled.org/core/appview/notify/logging" phnotify "tangled.org/core/appview/notify/posthog" whnotify "tangled.org/core/appview/notify/webhook" @@ -181,6 +182,16 @@ func Make(ctx context.Context, config *config.Config) (*State, error) { notifier := notify.NewMergedNotifier(notifiers) notifier = lognotify.NewLoggingNotifier(notifier, tlog.SubLogger(logger, "notify")) + // Start the email digest dispatcher if Resend is configured. + if config.Resend.ApiKey != "" { + dispatcher := emaildispatch.NewDispatcher( + d, config.Resend, config.Core.BaseUrl(), res, + tlog.SubLogger(logger, "email-dispatcher"), + config.Core.Dev, + ) + go dispatcher.Start(ctx) + } + ingester := appview.Ingester{ Ctx: ctx, Db: d, -- 2.51.2