notification email on student unlinking

parent 1457e190
Showing with 10 additions and 5 deletions
...@@ -475,6 +475,9 @@ module.exports = { ...@@ -475,6 +475,9 @@ module.exports = {
}) })
.spread((stuSup, student) => { .spread((stuSup, student) => {
if (!student)
throw new Error("Student not found");
// //
// Remove relationship // Remove relationship
// //
...@@ -486,10 +489,7 @@ module.exports = { ...@@ -486,10 +489,7 @@ module.exports = {
// //
student = student.toJSON(); student = student.toJSON();
if (student.license && student.license.number) { if (student.license && student.license.number) {
mailService.mailer() var message = sails.__(
.send({
to: supervisor.email,
text: sails.__(
{ {
phrase: 'student_unlinked', phrase: 'student_unlinked',
locale: supervisor.lang locale: supervisor.lang
...@@ -498,7 +498,12 @@ module.exports = { ...@@ -498,7 +498,12 @@ module.exports = {
name: student.name, name: student.name,
surname: student.surname, surname: student.surname,
license: student.license.number license: student.license.number
}) });
console.log("-->" + message);
mailService.mailer()
.send({
to: supervisor.email,
text: message
}) })
.then(() => {}) .then(() => {})
.catch((err) => {}); .catch((err) => {});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment