0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Added emailAnalytics config feature flag (#12443)

no issue

- email analytics may be desirable to fully switch off in certain circumstances, when that happens we want to prevent related background jobs from running and expose the feature flag via the config endpoint in the Admin API so that clients can adjust accordingly
This commit is contained in:
Kevin Ansfield 2020-12-02 13:22:12 +00:00 committed by GitHub
parent 2951eb9eaf
commit f802128cfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

View file

@ -20,7 +20,8 @@ module.exports = {
clientExtensions: config.get('clientExtensions') || {},
enableDeveloperExperiments: config.get('enableDeveloperExperiments') || false,
stripeDirect: config.get('stripeDirect'),
mailgunIsConfigured: config.get('bulkEmail') && config.get('bulkEmail').mailgun
mailgunIsConfigured: config.get('bulkEmail') && config.get('bulkEmail').mailgun,
emailAnalytics: config.get('emailAnalytics')
};
if (billingUrl) {
response.billingUrl = billingUrl;

View file

@ -10,6 +10,7 @@ module.exports = {
async scheduleRecurringJobs() {
if (
!hasScheduled &&
config.get('emailAnalytics') &&
config.get('backgroundJobs:emailAnalytics') &&
!process.env.NODE_ENV.match(/^testing/)
) {

View file

@ -116,6 +116,7 @@
"sendWelcomeEmail": true,
"stripeDirect": false,
"enableStripePromoCodes": false,
"emailAnalytics": true,
"backgroundJobs": {
"emailAnalytics": true
}

View file

@ -24,7 +24,7 @@ const expectedProperties = {
action: ['id', 'resource_type', 'actor_type', 'event', 'created_at', 'actor'],
config: ['version', 'environment', 'database', 'mail', 'labs', 'clientExtensions', 'enableDeveloperExperiments', 'useGravatar', 'stripeDirect'],
config: ['version', 'environment', 'database', 'mail', 'labs', 'clientExtensions', 'enableDeveloperExperiments', 'useGravatar', 'stripeDirect', 'emailAnalytics'],
post: _(schema.posts)
.keys()