@@ -11,6 +11,7 @@ exports = module.exports = {
|
||||
setCatchAllAddress,
|
||||
setMailRelay,
|
||||
setMailEnabled,
|
||||
setBanner,
|
||||
|
||||
sendTestMail,
|
||||
|
||||
@@ -261,6 +262,20 @@ function setAliases(req, res, next) {
|
||||
});
|
||||
}
|
||||
|
||||
function setBanner(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.domain, 'string');
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
|
||||
if (typeof req.body.text !== 'string') return res.status(400).send({ message: 'text must be a string' });
|
||||
if ('html' in req.body && typeof req.body.html !== 'string') return res.status(400).send({ message: 'html must be a string' });
|
||||
|
||||
mail.setBanner(req.params.domain, { text: req.body.text, html: req.body.html || null }, function (error) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202));
|
||||
});
|
||||
}
|
||||
|
||||
function getLists(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.domain, 'string');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user