IMA-WorldHealth / bhima

A hospital information management application for rural Congolese hospitals
GNU General Public License v2.0
211 stars 102 forks source link

(feature request) Email the administrative accounts when a new user is added #1579

Open jniles opened 7 years ago

jniles commented 7 years ago

There are a few users in the HEV production database that look like they may have been added by someone with admin access but not necessarily the administrator. The User Management module is only really visited when needed, so these accounts could persist for a long time without being detected by the hospital administration.

We could avoid these types of issues by emailing an administrative email address (or all super users) when a user has been added. This would ensure that the administration is kept in the loop in case someone was messing around with the production database.

jniles commented 6 years ago

Since we added emailing in #2310, all the infrastructure exists for this. It should be an easy issue to implement.

erdahuja commented 6 years ago

@jniles we can setup a subscription grahphql which triggers the publish and send email to admins using nodemailer?

jniles commented 6 years ago

I've never used GraphQL and I don't see the benefit for it here. Do you have a proposal in mind?

We use mailgun-js as our mail delivery library, all wrapped up in the server/lib/mailer.js library. This library could evolve with time, if needed.