diff --git a/app/scenes/Settings/Notifications.js b/app/scenes/Settings/Notifications.js index edcc0013a..8b63e7435 100644 --- a/app/scenes/Settings/Notifications.js +++ b/app/scenes/Settings/Notifications.js @@ -12,6 +12,7 @@ import Notice from "components/Notice"; import Scene from "components/Scene"; import Subheading from "components/Subheading"; import NotificationListItem from "./components/NotificationListItem"; +import env from "env"; import useCurrentUser from "hooks/useCurrentUser"; import useStores from "hooks/useStores"; import useToasts from "hooks/useToasts"; @@ -90,6 +91,8 @@ function Notifications() { return ( }> + {t("Notifications")} + {showSuccessNotice && ( @@ -97,40 +100,55 @@ function Notifications() { )} - {t("Notifications")} Manage when and where you receive email notifications from Outline. Your email address can be updated in your SSO provider. - - {t("Notifications")} - - {options.map((option, index) => { - if (option.separator) return ; - - const setting = notificationSettings.getByEvent(option.event); - - return ( - + - ); - })} + + {t("Notifications")} + + {options.map((option, index) => { + if (option.separator) { + return ; + } + + const setting = notificationSettings.getByEvent(option.event); + + return ( + + ); + })} + + ) : ( + + + The email integration is currently disabled. Please set the + associated environment variables and restart the server to enable + notifications. + + + )} ); } diff --git a/server/presenters/env.js b/server/presenters/env.js index 3b361f6ba..30be71074 100644 --- a/server/presenters/env.js +++ b/server/presenters/env.js @@ -17,6 +17,8 @@ export default function present(env: Object): Object { SLACK_APP_ID: env.SLACK_APP_ID, MAXIMUM_IMPORT_SIZE: env.MAXIMUM_IMPORT_SIZE || 1024 * 1000 * 5, SUBDOMAINS_ENABLED: env.SUBDOMAINS_ENABLED === "true", + NOTIFICATIONS_ENABLED: + !!env.SMTP_USERNAME || env.NODE_ENV === "development", GOOGLE_ANALYTICS_ID: env.GOOGLE_ANALYTICS_ID, RELEASE: env.SOURCE_COMMIT || env.SOURCE_VERSION || undefined, }; diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 340928f92..2cd2fe439 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -549,6 +549,7 @@ "Unsubscription successful. Your notification settings were updated": "Unsubscription successful. Your notification settings were updated", "Manage when and where you receive email notifications from Outline. Your email address can be updated in your SSO provider.": "Manage when and where you receive email notifications from Outline. Your email address can be updated in your SSO provider.", "Email address": "Email address", + "The email integration is currently disabled. Please set the associated environment variables and restart the server to enable the integration.": "The email integration is currently disabled. Please set the associated environment variables and restart the server to enable the integration.", "Everyone that has signed into Outline appears here. It’s possible that there are other users who have access through {team.signinMethods} but haven’t signed in yet.": "Everyone that has signed into Outline appears here. It’s possible that there are other users who have access through {team.signinMethods} but haven’t signed in yet.", "Filter": "Filter", "Profile saved": "Profile saved", @@ -578,6 +579,7 @@ "Connect Outline collections to Slack channels and messages will be automatically posted to Slack when documents are published or updated.": "Connect Outline collections to Slack channels and messages will be automatically posted to Slack when documents are published or updated.", "Connected to the {{ channelName }} channel": "Connected to the {{ channelName }} channel", "Connect": "Connect", + "The Slack integration is currently disabled. Please set the associated environment variables and restart the server to enable the integration.": "The Slack integration is currently disabled. Please set the associated environment variables and restart the server to enable the integration.", "New token": "New token", "You can create an unlimited amount of personal tokens to authenticate\n with the API. Tokens have the same permissions as your user account.\n For more details see the developer documentation.": "You can create an unlimited amount of personal tokens to authenticate\n with the API. Tokens have the same permissions as your user account.\n For more details see the developer documentation.", "Tokens": "Tokens",