notification email on student unlinking

parent 1457e190
Showing with 15 additions and 10 deletions
......@@ -475,6 +475,9 @@ module.exports = {
})
.spread((stuSup, student) => {
if (!student)
throw new Error("Student not found");
//
// Remove relationship
//
......@@ -486,19 +489,21 @@ module.exports = {
//
student = student.toJSON();
if (student.license && student.license.number) {
var message = sails.__(
{
phrase: 'student_unlinked',
locale: supervisor.lang
},
{
name: student.name,
surname: student.surname,
license: student.license.number
});
console.log("-->" + message);
mailService.mailer()
.send({
to: supervisor.email,
text: sails.__(
{
phrase: 'student_unlinked',
locale: supervisor.lang
},
{
name: student.name,
surname: student.surname,
license: student.license.number
})
text: message
})
.then(() => {})
.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