Added "email_track_opens" setting (#12404)

refs https://github.com/TryGhost/Ghost/issues/12390

- adds "email_track_opens" setting to the `email` group, defaulting to `true`
This commit is contained in:
Kevin Ansfield 2020-11-23 18:36:12 +00:00 committed by GitHub
parent 4c96aa5c95
commit ea77f3f349
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,16 @@
const logging = require('../../../../../shared/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(connection) {
logging.info('Updating email_track_opens setting to email group');
await connection('settings')
.whereIn('key', ['email_track_opens'])
.update({
group: 'email'
});
},
async function down() {}
);

View File

@ -353,6 +353,14 @@
"mailgun_base_url": {
"defaultValue": null,
"type": "string"
},
"email_track_opens": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [["true", "false"]]
},
"type": "boolean"
}
},
"amp": {

View File

@ -59,6 +59,7 @@ const defaultSettingsKeyTypes = [
{key: 'mailgun_api_key', type: 'bulk_email'},
{key: 'mailgun_domain', type: 'bulk_email'},
{key: 'mailgun_base_url', type: 'bulk_email'},
{key: 'email_track_opens', type: 'bulk_email'},
{key: 'amp', type: 'blog'},
{key: 'amp_gtag_id', type: 'blog'},
{key: 'labs', type: 'blog'},

View File

@ -56,6 +56,7 @@ const defaultSettingsKeyTypes = [
{key: 'mailgun_api_key', type: 'bulk_email'},
{key: 'mailgun_domain', type: 'bulk_email'},
{key: 'mailgun_base_url', type: 'bulk_email'},
{key: 'email_track_opens', type: 'bulk_email'},
{key: 'amp', type: 'blog'},
{key: 'amp_gtag_id', type: 'blog'},
{key: 'labs', type: 'blog'},

View File

@ -59,6 +59,7 @@ const defaultSettingsKeys = [
'mailgun_api_key',
'mailgun_domain',
'mailgun_base_url',
'email_track_opens',
'amp',
'amp_gtag_id',
'labs',

View File

@ -34,7 +34,7 @@ describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = 'ce6d902fd2b0e3921ffb76d61a35e285';
const currentFixturesHash = 'd46d696c94d03e41a5903500547fea77';
const currentSettingsHash = 'b7c0c2c6a4c61561dfefe642470d30f8';
const currentSettingsHash = 'd3821715e4b34d92d6ba6ed0d4918f5c';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
// If this test is failing, then it is likely a change has been made that requires a DB version bump,