eventlog: add email enabled/disabled events

This commit is contained in:
Girish Ramakrishnan
2018-11-09 18:51:58 -08:00
parent 4aa76a859f
commit 0d65635bc4
3 changed files with 6 additions and 3 deletions

View File

@@ -186,7 +186,7 @@ function setMailEnabled(req, res, next) {
if (typeof req.body.enabled !== 'boolean') return next(new HttpError(400, 'enabled is required'));
mail.setMailEnabled(req.params.domain, !!req.body.enabled, function (error) {
mail.setMailEnabled(req.params.domain, !!req.body.enabled, auditSource(req), function (error) {
if (error && error.reason === MailError.NOT_FOUND) return next(new HttpError(404, error.message));
if (error && error.reason === MailError.BAD_FIELD) return next(new HttpError(400, error.message));
if (error && error.reason === MailError.BILLING_REQUIRED) return next(new HttpError(402, error.message));