diff --git a/web/src/settings_config.ts b/web/src/settings_config.ts index 19c31b39da..bdfb6bcd97 100644 --- a/web/src/settings_config.ts +++ b/web/src/settings_config.ts @@ -862,6 +862,7 @@ export type AllNotifications = { disabled_notification_settings: { push_notifications: boolean; enable_online_push_notifications: boolean; + message_content_in_email_notifications: boolean; }; }; @@ -898,6 +899,8 @@ export const all_notifications = (settings_object: Settings): AllNotifications = disabled_notification_settings: { push_notifications: !realm.realm_push_notifications_enabled, enable_online_push_notifications: !realm.realm_push_notifications_enabled, + message_content_in_email_notifications: + !realm.realm_message_content_allowed_in_email_notifications, }, }); diff --git a/web/src/tippyjs.ts b/web/src/tippyjs.ts index 1edf8bb8d9..d2c6f1d5b0 100644 --- a/web/src/tippyjs.ts +++ b/web/src/tippyjs.ts @@ -531,6 +531,24 @@ export function initialize(): void { }, }); + tippy.delegate("body", { + target: "#user_message_content_in_email_notifications_label", + onShow(instance) { + if ($("#user_message_content_in_email_notifications").prop("disabled")) { + instance.setContent( + $t({ + defaultMessage: + "Including message content in message notification emails is not allowed in this organization.", + }), + ); + return undefined; + } + instance.destroy(); + return false; + }, + appendTo: () => document.body, + }); + tippy.delegate("body", { target: ".views-tooltip-target", onShow(instance) { diff --git a/web/templates/settings/notification_settings.hbs b/web/templates/settings/notification_settings.hbs index 79168a5cbe..4f654086f9 100644 --- a/web/templates/settings/notification_settings.hbs +++ b/web/templates/settings/notification_settings.hbs @@ -212,6 +212,7 @@ setting_name=this is_checked=(lookup ../settings_object this) label=(lookup ../settings_label this) + is_disabled=(lookup ../disabled_notification_settings this) prefix=../prefix}} {{/each}}