diff --git a/README.md b/README.md index c8c4e946..ff42ece3 100644 --- a/README.md +++ b/README.md @@ -455,6 +455,10 @@ Add this snippet to the bottom of web page: theme: 'dark', // optional param; if it isn't defined default value ('light') will be used page_title: 'Moving to Remark42', // optional param; if it isn't defined `document.title` will be used locale: 'en' // set up locale and language, if it isn't defined default value ('en') will be used + show_email_subscription: false // optional param; by default it is `true` and you can see email subscription feature + // in interface when enable it from backend side + // if you set this param in `false` you will get notifications email notifications as admin + // but your users won't have interface for subscription }; (function(c) { diff --git a/frontend/app/common/config-types.ts b/frontend/app/common/config-types.ts index 5a48c825..e2fdd913 100644 --- a/frontend/app/common/config-types.ts +++ b/frontend/app/common/config-types.ts @@ -17,6 +17,7 @@ export interface CommentsConfig { page_title?: string; node?: string | HTMLElement; locale?: string; + show_email_subscription?: boolean; // eslint-disable-next-line @typescript-eslint/no-explicit-any __colors__?: any; } diff --git a/frontend/app/common/settings.ts b/frontend/app/common/settings.ts index 339211bf..e36b3757 100644 --- a/frontend/app/common/settings.ts +++ b/frontend/app/common/settings.ts @@ -10,6 +10,7 @@ export interface QuerySettingsType { theme: Theme; /* used in delete users data page */ token?: string; + show_email_subscription?: boolean; } export const querySettings: Partial = parseQuery(); @@ -25,6 +26,9 @@ if (!querySettings.theme || THEMES.indexOf(querySettings.theme) === -1) { querySettings.theme = THEMES[0]; } +// eslint-disable-next-line @typescript-eslint/no-explicit-any +querySettings.show_email_subscription = (querySettings.show_email_subscription as any) !== 'false'; + export const siteId = querySettings.site_id; export const pageTitle = querySettings.page_title; export const url = querySettings.url; diff --git a/frontend/app/components/comment-form/comment-form.tsx b/frontend/app/components/comment-form/comment-form.tsx index 6d8cc7ea..d5d56a8c 100644 --- a/frontend/app/components/comment-form/comment-form.tsx +++ b/frontend/app/components/comment-form/comment-form.tsx @@ -535,7 +535,7 @@ export class CommentForm extends Component { {this.renderMarkdownTip()} {' '} - {StaticStore.config.email_notifications && ( + {StaticStore.config.email_notifications && StaticStore.query.show_email_subscription && ( {' '}