diff --git a/src/mailer.js b/src/mailer.js index cb9ebdff1..cb757fad4 100644 --- a/src/mailer.js +++ b/src/mailer.js @@ -22,7 +22,8 @@ exports = module.exports = { FEEDBACK_TYPE_FEEDBACK: 'feedback', FEEDBACK_TYPE_TICKET: 'ticket', - FEEDBACK_TYPE_APP: 'app', + FEEDBACK_TYPE_APP_MISSING: 'app_missing', + FEEDBACK_TYPE_APP_ERROR: 'app_error', sendFeedback: sendFeedback, _getMailQueue: _getMailQueue, @@ -396,7 +397,10 @@ function sendFeedback(user, type, subject, description) { assert.strictEqual(typeof subject, 'string'); assert.strictEqual(typeof description, 'string'); - assert(type === exports.FEEDBACK_TYPE_TICKET || type === exports.FEEDBACK_TYPE_FEEDBACK || type === exports.FEEDBACK_TYPE_APP); + assert(type === exports.FEEDBACK_TYPE_TICKET || + type === exports.FEEDBACK_TYPE_FEEDBACK || + type === exports.FEEDBACK_TYPE_APP_MISSING || + type === exports.FEEDBACK_TYPE_APP_ERROR); var mailOptions = { from: config.get('adminEmail'), diff --git a/src/routes/cloudron.js b/src/routes/cloudron.js index 13897c119..9cef3060e 100644 --- a/src/routes/cloudron.js +++ b/src/routes/cloudron.js @@ -131,7 +131,10 @@ function update(req, res, next) { function feedback(req, res, next) { assert.strictEqual(typeof req.user, 'object'); - if (req.body.type !== mailer.FEEDBACK_TYPE_FEEDBACK && req.body.type !== mailer.FEEDBACK_TYPE_TICKET && req.body.type !== mailer.FEEDBACK_TYPE_APP) return next(new HttpError(400, 'type must be either "ticket", "feedback" or "app"')); + if (req.body.type !== mailer.FEEDBACK_TYPE_FEEDBACK && + req.body.type !== mailer.FEEDBACK_TYPE_TICKET && + req.body.type !== mailer.FEEDBACK_TYPE_APP_MISSING && + req.body.type !== mailer.FEEDBACK_TYPE_APP_ERROR) return next(new HttpError(400, 'type must be either "ticket", "feedback" or "app_missing" or "app_error"')); if (typeof req.body.subject !== 'string' || !req.body.subject) return next(new HttpError(400, 'subject must be string')); if (typeof req.body.description !== 'string' || !req.body.description) return next(new HttpError(400, 'description must be string')); diff --git a/webadmin/src/views/support.html b/webadmin/src/views/support.html index 36617fe4f..093969b6b 100644 --- a/webadmin/src/views/support.html +++ b/webadmin/src/views/support.html @@ -35,7 +35,8 @@