mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
Use Benchpress (#5901)
* Use Benchpress * Use Benchpress.compileParse * Error for template load failure * Use benchpressjs package * Compile templates on demand * Fix user settings page * Fix admin search to exclude `.jst` files * Fix 500-embed So ajaxify can still show an error if the server goes down
This commit is contained in:
committed by
Barış Soner Uşaklı
parent
864321f727
commit
abffc29128
@@ -3,7 +3,7 @@
|
||||
var async = require('async');
|
||||
var winston = require('winston');
|
||||
var nconf = require('nconf');
|
||||
var templates = require('templates.js');
|
||||
var Benchpress = require('benchpressjs');
|
||||
var nodemailer = require('nodemailer');
|
||||
var sendmailTransport = require('nodemailer-sendmail-transport');
|
||||
var smtpTransport = require('nodemailer-smtp-transport');
|
||||
@@ -173,9 +173,9 @@ Emailer.sendViaFallback = function (data, callback) {
|
||||
};
|
||||
|
||||
function render(tpl, params, next) {
|
||||
if (meta.config['email:custom:' + tpl.replace('emails/', '')]) {
|
||||
var text = templates.parse(meta.config['email:custom:' + tpl.replace('emails/', '')], params);
|
||||
next(null, text);
|
||||
var customTemplate = meta.config['email:custom:' + tpl.replace('emails/', '')];
|
||||
if (customTemplate) {
|
||||
Benchpress.compileParse(customTemplate, params, next);
|
||||
} else {
|
||||
app.render(tpl, params, next);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user