diff --git a/lib/applications.js b/lib/applications.js index b5718ebae..accbf9c5e 100644 --- a/lib/applications.js +++ b/lib/applications.js @@ -255,7 +255,7 @@ exports.updateApplication = async (req, res) => { req.body.first_name = user.first_name; req.body.last_name = user.last_name; req.body.gender = user.gender; - req.body.email = user.email; + req.body.email = user.notification_email; req.body.date_of_birth = user.date_of_birth; if (req.body.body_id) { // Shouldn't crash, if the person is not a member of a body, @@ -296,7 +296,7 @@ exports.updateApplication = async (req, res) => { if (boardMembers.length > 0) { await mailer.sendMail({ - to: boardMembers.map(member => member.user.email), + to: boardMembers.map(member => member.user.notification_email), subject: `One of your body members changed the application to ${req.event.name}`, template: 'statutory_board_edited.html', parameters: { @@ -612,7 +612,7 @@ exports.postApplication = async (req, res) => { req.body.first_name = req.user.first_name; req.body.last_name = req.user.last_name; req.body.gender = req.user.gender; - req.body.email = req.user.email; + req.body.email = req.user.notification_email; req.body.body_name = req.user.bodies.find(b => req.body.body_id === b.id).name; req.body.date_of_birth = req.user.date_of_birth; @@ -643,7 +643,7 @@ exports.postApplication = async (req, res) => { if (boardMembers.length > 0) { await mailer.sendMail({ - to: boardMembers.map(member => member.user.email), + to: boardMembers.map(member => member.user.notification_email), subject: `One of your body members has applied to ${req.event.name}`, template: 'statutory_board_applied.html', parameters: {