Skip to content

Commit

Permalink
chore(mail): update to field mailer
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonVreling committed Nov 14, 2020
1 parent 7c51ce0 commit 47c4373
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/applications.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 47c4373

Please sign in to comment.