diff --git a/client/coral-admin/src/components/UserAction.js b/client/coral-admin/src/components/UserAction.js index f58ef181b..6f883d788 100644 --- a/client/coral-admin/src/components/UserAction.js +++ b/client/coral-admin/src/components/UserAction.js @@ -18,8 +18,9 @@ const UserAction = props => { let userStatus = user.status; const links = user.settings.bio ? linkify.getMatches(user.settings.bio) : []; - //Do not display if the user status is 'active'. This means that they have already been reviewed and approved. - return userStatus !== 'active' && + // Do not display unless the user status is 'pending' or 'banned'. + // This means that they have already been reviewed and approved. + return (userStatus === 'pending' || userStatus === 'banned') &&
  • diff --git a/routes/api/users/index.js b/routes/api/users/index.js index 9bf7d6b10..cbc3e9f4c 100644 --- a/routes/api/users/index.js +++ b/routes/api/users/index.js @@ -63,13 +63,15 @@ router.post('/:user_id/email', authorization.needed('admin'), (req, res, next) = body: req.body.body }, subject: req.body.subject, - to: user.email + to: user.profiles[0].id // This only works if the user has registered via e-mail. + // We may want a standard way to access a user's e-mail address in the future }; return mailer.sendSimple(options); }) .then(() => { res.status(204).end(); - }); + }) + .catch(next); }); router.post('/', (req, res, next) => { diff --git a/views/email/notification-email-text.ejs b/views/email/notification.ejs similarity index 100% rename from views/email/notification-email-text.ejs rename to views/email/notification.ejs diff --git a/views/email/notification-email.ejs b/views/email/notification.txt.ejs similarity index 100% rename from views/email/notification-email.ejs rename to views/email/notification.txt.ejs