fix: #9002 ban templates not user friendly

v1.18.x
psychobunny 4 years ago
parent 202dcef42e
commit 4317cdea34

@ -3,7 +3,6 @@
const winston = require('winston'); const winston = require('winston');
const meta = require('../meta'); const meta = require('../meta');
const utils = require('../utils');
const emailer = require('../emailer'); const emailer = require('../emailer');
const db = require('../database'); const db = require('../database');
@ -47,10 +46,11 @@ module.exports = function (User) {
// Email notification of ban // Email notification of ban
const username = await User.getUserField(uid, 'username'); const username = await User.getUserField(uid, 'username');
const siteTitle = meta.config.title || 'NodeBB'; const siteTitle = meta.config.title || 'NodeBB';
const data = { const data = {
subject: '[[email:banned.subject, ' + siteTitle + ']]', subject: '[[email:banned.subject, ' + siteTitle + ']]',
username: username, username: username,
until: until ? utils.toISOString(until) : false, until: until ? (new Date(until)).toUTCString().replace(/,/g, '\\,') : false,
reason: reason, reason: reason,
}; };
try { try {

Loading…
Cancel
Save