mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
fix: #7470 Properly handle recompilation of email templates
This commit is contained in:
@@ -344,9 +344,13 @@ function buildCustomTemplates(config) {
|
|||||||
}, next);
|
}, next);
|
||||||
},
|
},
|
||||||
function (result, next) {
|
function (result, next) {
|
||||||
var templates = result.templates.filter(function (template) {
|
// If the new config contains any email override values, re-compile those templates
|
||||||
return template.isCustom && template.text !== prevConfig['email:custom:' + path];
|
var toBuild = Object
|
||||||
});
|
.keys(config)
|
||||||
|
.filter(prop => prop.startsWith('email:custom:'))
|
||||||
|
.map(key => key.split(':')[2]);
|
||||||
|
|
||||||
|
var templates = result.templates.filter(template => toBuild.includes(template.path));
|
||||||
var paths = _.fromPairs(result.paths.map(function (p) {
|
var paths = _.fromPairs(result.paths.map(function (p) {
|
||||||
var relative = path.relative(viewsDir, p).replace(/\\/g, '/');
|
var relative = path.relative(viewsDir, p).replace(/\\/g, '/');
|
||||||
return [relative, p];
|
return [relative, p];
|
||||||
|
|||||||
Reference in New Issue
Block a user