-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from lennygir/feat/198-notify-added-cosup
feat: notify added cosupervisors
- Loading branch information
Showing
4 changed files
with
102 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const addedCosupervisorHtmlTemplate = (variables) => { | ||
return ` | ||
<html> | ||
<body> | ||
<p>Dear ${variables.name},</p> | ||
<p>You have been added to the list of co-supervisors for the following thesis proposal:</p> | ||
<p>Title: ${variables.proposal.title}</p> | ||
<p>Consult the list of proposals to have more details.</p> | ||
<p>Best regards,</p> | ||
<p>the Thesis Managment system</p> | ||
</body> | ||
</html> | ||
`; | ||
}; | ||
|
||
const addedCosupervisorTextTemplate = (variables) => { | ||
return `Dear ${variables.name}, You have been added to the list of co-supervisors for the following thesis proposal:\nTitle: ${variables.proposal.title}\nConsult the list of proposals to have more details.\nBest regards,\nthe Thesis Managment system\n`; | ||
}; | ||
|
||
exports.addedCosupervisorTemplate = (variables) => ({ | ||
html: addedCosupervisorHtmlTemplate(variables), | ||
text: addedCosupervisorTextTemplate(variables) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ const { | |
getRequestsForClerk, | ||
getProposalsThatExpireInXDays, | ||
notifyRemovedCosupervisors, | ||
notifyAddedCosupervisors, | ||
} = require("../src/theses-dao"); | ||
|
||
const dayjs = require("dayjs"); | ||
|
@@ -969,6 +970,7 @@ describe("PUT /api/proposals/:id", () => { | |
|
||
const originalModule = jest.requireActual("../src/theses-dao"); | ||
notifyRemovedCosupervisors.mockImplementation(originalModule.notifyRemovedCosupervisors); | ||
notifyAddedCosupervisors.mockImplementation(originalModule.notifyAddedCosupervisors); | ||
|
||
isLoggedIn.mockImplementation((req, res, next) => { | ||
req.user = { | ||
|
@@ -999,7 +1001,9 @@ describe("PUT /api/proposals/:id", () => { | |
id: 1, | ||
title: "test", | ||
description: "desc test", | ||
co_supervisors: [], | ||
co_supervisors: [ | ||
"[email protected]" | ||
], | ||
keywords: ["keyword1", "keyword2"], | ||
groups: [], | ||
types: ["EXPERIMENTAL"], | ||
|