From 5c92f85d51a6b1ec48bb8b08d4f9cc3fa577cc59 Mon Sep 17 00:00:00 2001 From: Kristina <7614497+khjrtbrg@users.noreply.github.com> Date: Wed, 15 Apr 2026 11:05:38 +0200 Subject: [PATCH] [web] track email notification settings interactions (#32719) * send setting-changed event * emit event for global mute notifications GitOrigin-RevId: 0705ffc331185e0f49fa1103e856040548d4f8bf --- .../hooks/use-project-notification-preferences.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/settings/hooks/use-project-notification-preferences.ts b/services/web/frontend/js/features/settings/hooks/use-project-notification-preferences.ts index c85b0941a2..97a92d65ca 100644 --- a/services/web/frontend/js/features/settings/hooks/use-project-notification-preferences.ts +++ b/services/web/frontend/js/features/settings/hooks/use-project-notification-preferences.ts @@ -3,6 +3,8 @@ import { useProjectContext } from '@/shared/context/project-context' import { getJSON, postJSON } from '@/infrastructure/fetch-json' import { debugConsole } from '@/utils/debugging' import type { NotificationPreferencesSchema } from '../../../../../modules/notifications/app/src/types.js' +import { sendMB } from '@/infrastructure/event-tracking' +import { useIdeReactContext } from '@/features/ide-react/context/ide-react-context' export type NotificationLevel = 'all' | 'replies' | 'off' @@ -83,6 +85,7 @@ function preferencesToLevel( export function useProjectNotificationPreferences() { const { projectId } = useProjectContext() + const { permissionsLevel } = useIdeReactContext() const [notificationLevel, setNotificationLevel] = useState('all') const [isLoading, setIsLoading] = useState(true) @@ -103,11 +106,16 @@ export function useProjectNotificationPreferences() { (level: NotificationLevel) => { setNotificationLevel(level) const preferences = levelToPreferences(level) + sendMB('setting-changed', { + changedSetting: 'projectEmailNotifications', + changedSettingVal: level, + projectRole: permissionsLevel, + }) postJSON(`/notifications/preferences/project/${projectId}`, { body: preferences, }).catch(debugConsole.error) }, - [projectId] + [projectId, permissionsLevel] ) return {