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:
parent
8696e1c12f
commit
20b17b64b7
3 changed files with 36 additions and 1 deletions
|
@ -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, '&').replace(/>/g, '>').replace(/</g, '<').replace(/"/g, '"').replace(/'/g, '''); 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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue