|
|
@ -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 {
|
|
|
|