Hello{{if .Name}} {{.Name}}{{end}},
+Here is what happened while you were away:
+You get this email because you have unread notifications. Turn these emails off in your notification settings.
diff --git a/Server/internal/mail/templates/digest.txt b/Server/internal/mail/templates/digest.txt new file mode 100644 index 0000000..8ec04e5 --- /dev/null +++ b/Server/internal/mail/templates/digest.txt @@ -0,0 +1,9 @@ +{{.Count}} new {{if eq .Count 1}}notification{{else}}notifications{{end}} on {{.AppName}} +Hello{{if .Name}} {{.Name}}{{end}}, + +Here is what happened while you were away: +{{range .Items}} +- {{.Text}} + {{.Link}} +{{end}} +You get this email because you have unread notifications. Turn these emails off in your notification settings: {{.SettingsLink}} diff --git a/Web-App/frontend/src/components/AppLayout.vue b/Web-App/frontend/src/components/AppLayout.vue index 46365b0..a36018d 100644 --- a/Web-App/frontend/src/components/AppLayout.vue +++ b/Web-App/frontend/src/components/AppLayout.vue @@ -8,6 +8,7 @@ import { useFormErrors } from "../composables/useFormErrors"; import { SIDEBAR_DEFAULT, clampWidth, useSidebar } from "../composables/useSidebar"; import { useAuthStore } from "../stores/auth"; import { useFavoritesStore } from "../stores/favorites"; +import { useNotificationsStore } from "../stores/notifications"; import { useSpacesStore } from "../stores/spaces"; import { atLeast, useWorkspacesStore } from "../stores/workspaces"; import PageTreeNode from "./PageTreeNode.vue"; @@ -22,6 +23,7 @@ const auth = useAuthStore(); const workspaces = useWorkspacesStore(); const spaces = useSpacesStore(); const favorites = useFavoritesStore(); +const notifications = useNotificationsStore(); const router = useRouter(); const route = useRoute(); const { mode } = useTheme(); @@ -37,6 +39,8 @@ function showError(e: unknown) { } onMounted(() => workspaces.load().catch(showError)); +onMounted(() => notifications.start()); +onBeforeUnmount(() => notifications.stop()); watch( () => workspaces.current?.id, (id) => { @@ -192,6 +196,15 @@ function signOut() {