Skip to content

Commit 319711c

Browse files
authoredJan 24, 2025
Merge branch 'master' into remove-project-owner
2 parents 17f9bcd + 061b966 commit 319711c

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed
 

‎CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* add a readonly input field under email for showing the email domain*
1212
* Add "custom_users" key to config file, to be used with various scripts
1313
* Check that user being removed is not owner or last member of a project
14+
* Add email sent to a project owner when their project is activated
1415
* Separate global overview from individual group view in admin group management
1516
* Allow accents in user's first and last names
1617

‎config/default.json.template

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,18 @@
315315
"<p>You will receive an email when your account has been validated.</p>",
316316
"<hr>"
317317
],
318+
"activated_project": [
319+
"Your requested project '#NAME#' has been approved and activated by an admin in My.",
320+
"It is for members of the '#GROUP#' group, you can find it at the following path:",
321+
"'#PATH#'",
322+
"Congratulations!"
323+
],
324+
"activated_project_html": [
325+
"<p>Your requested project '#NAME#' has been approved and activated by an admin in My.</p>",
326+
"<p>It is for members of the '#GROUP#' group, you can find it at the following path:</p>",
327+
"<p>'#PATH#'</p>",
328+
"<p>Congratulations!</p>"
329+
],
318330
"add_to_project": [
319331
"#UID# has been added to project '#NAME#' in My",
320332
"#DESC#",

‎config/test.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,18 @@
255255
"<p>You will receive an email when your account has been validated.</p>",
256256
"<hr>"
257257
],
258+
"activated_project": [
259+
"Your requested project '#NAME#' has been approved and activated by an admin in My.",
260+
"It is for members of the '#GROUP#' group, you can find it at the following path:",
261+
"'#PATH#'",
262+
"Congratulations!"
263+
],
264+
"activated_project_html": [
265+
"<p>Your requested project '#NAME#' has been approved and activated by an admin in My.</p>",
266+
"<p>It is for members of the '#GROUP#' group, you can find it at the following path:</p>",
267+
"<p>'#PATH#'</p>",
268+
"<p>Congratulations!</p>"
269+
],
258270
"add_to_project": [
259271
"#UID# has been added to project '#NAME#' in My",
260272
"#DESC#",

‎core/project.service.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,25 @@ async function create_project(new_project, uuid, action_owner = 'auto') {
5454
catch(error) {
5555
logger.error(error);
5656
}
57+
58+
const owner = await dbsrv.mongo_users().findOne({ uid: new_project.owner });
59+
const msg_destinations = [owner.email];
60+
if (owner.send_copy_to_support) {
61+
msg_destinations.push(CONFIG.general.support);
62+
}
63+
try {
64+
await maisrv.send_notif_mail( {
65+
'name': 'ask_project',
66+
'destinations': msg_destinations,
67+
'subject': 'Project ' + new_project.id + ' created'
68+
}, {
69+
'#NAME#': new_project.id,
70+
'#PATH#': new_project.path,
71+
'#GROUP#':new_project.group
72+
});
73+
} catch(error) {
74+
logger.error(error);
75+
}
5776
return new_project;
5877
}
5978

0 commit comments

Comments
 (0)