Fixed Merge Tags for custom date fields

This commit is contained in:
witzig 2017-06-02 03:05:19 +02:00
parent 466bf225a3
commit cec227d688
2 changed files with 4 additions and 2 deletions

View file

@ -4,6 +4,7 @@ let config = require('config');
let mysql = require('mysql');
let redis = require('redis');
let Lock = require('redfour');
let stringifyDate = require('json-stringify-date');
let tools = require('./tools');
module.exports = mysql.createPool(config.mysql);
@ -42,7 +43,7 @@ if (config.redis && config.redis.enabled) {
return setImmediate(() => callback());
}
module.exports.redis.multi().
lpush('mailtrain:cache:' + key, JSON.stringify(value)).
lpush('mailtrain:cache:' + key, stringifyDate.stringify(value)).
expire('mailtrain:cache:' + key, 24 * 3600).
exec(err => callback(err));
};
@ -53,7 +54,7 @@ if (config.redis && config.redis.enabled) {
return callback(err);
}
try {
value = JSON.parse(value);
value = stringifyDate.parse(value);
} catch (E) {
return callback(E);
}

View file

@ -83,6 +83,7 @@
"isemail": "^2.2.1",
"jquery-file-upload-middleware": "^0.1.8",
"jsdom": "^9.12.0",
"json-stringify-date": "^0.1.4",
"juice": "^4.0.2",
"libmime": "^3.1.0",
"mailparser": "^2.0.5",