1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

More work on device connect/disconnect email notifications.

This commit is contained in:
Ylian Saint-Hilaire 2021-10-11 09:38:30 -07:00
parent 8696e1c12f
commit 20b17b64b7
3 changed files with 36 additions and 1 deletions

View file

@ -27,6 +27,7 @@ module.exports.CreateMeshMail = function (parent, domain) {
obj.verifyemail = false;
obj.domain = domain;
//obj.mailTemplates = {};
const sortCollator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' })
const constants = (obj.parent.crypto.constants ? obj.parent.crypto.constants : require('constants')); // require('constants') is deprecated in Node 11.10, use require('crypto').constants instead.
function EscapeHtml(x) { if (typeof x == "string") return x.replace(/&/g, '&amp;').replace(/>/g, '&gt;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;'); if (typeof x == "boolean") return x; if (typeof x == "number") return x; }
@ -612,6 +613,10 @@ module.exports.CreateMeshMail = function (parent, domain) {
}
}
// Sort the notifications
connections.sort(sortCollator.compare);
disconnections.sort(sortCollator.compare);
// TODO: Send the email
//console.log('sendDeviceNotifications', connections, disconnections);