Email device connect/disconnect notifications now work.

This commit is contained in:
Ylian Saint-Hilaire 2021-10-11 11:56:14 -07:00
parent 20b17b64b7
commit 4ad9619bfb
42 changed files with 1223 additions and 18 deletions

36
emails/device-notify.html Normal file
View File

@ -0,0 +1,36 @@
<div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding=8>
<tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">click here</a> within 1 hour of getting this message.
</p>
</area-footer>
</div>

22
emails/device-notify.txt Normal file
View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">klikněte zde</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">hier klicken</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">haz clic aquí</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">klikkaa tästä</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">cliquez ici</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">यहाँ क्लिक करें</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">clicca qui</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">ここをクリック</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">여기를 클릭하십시오.</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">Klik hier</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">kliknij tutaj</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">Clique aqui</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">Clique aqui</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">кликните сюда</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">Klicka här</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">buraya Tıkla</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">点击这里</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -0,0 +1,36 @@
<html><head></head><body><div>[[[SERVERNAME]]] - Device Notification</div>
<div style="font-family:Arial,Helvetica,sans-serif">
<table style="background-color:#003366;color:lightgray;width:100%" cellpadding="8">
<tbody><tr>
<td>
<b style="font-size:20px;font-family:Arial,Helvetica,sans-serif">[[[SERVERNAME]]] - Device Notification</b>
</td>
</tr>
</tbody></table>
<area-header>
<p>
The folloing devices have changed their connection state.
</p>
</area-header>
<area-connections>
<p>
Connected devices:
</p>
<p><b>
[[[CONNECTIONS]]]
</b></p>
</area-connections>
<area-disconnections>
<p>
Disconnected devices:
</p>
<p><b>
[[[DISCONNECTIONS]]]
</b></p>
</area-disconnections>
<area-footer>
<p>
To unsubscribe, <a href="[[[SERVERURL]]][[[UNSUBSCRIBELINK]]]">點擊這裡</a> within 1 hour of getting this message.
</p>
</area-footer>
</div></body></html>

View File

@ -0,0 +1,22 @@
[[[SERVERNAME]]] - Device Notification
~<area-header>
The folloing devices have changed their connection state.
~</area-header>
~<area-connections>
~
Connected devices:
~
~[[[CONNECTIONS]]]
~
~</area-connections>
~<area-disconnections>
~
Disconnected devices:
~
~[[[DISCONNECTIONS]]]
~
~</area-disconnections>
~<area-footer>
To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]
~</area-footer>

View File

@ -337,6 +337,53 @@ module.exports.CreateMeshMail = function (parent, domain) {
});
};
// Send device connect/disconnect notification mail
obj.sendDeviceNotifyMail = function (domain, username, email, connections, disconnections, language, loginkey) {
obj.checkEmail(email, function (checked) {
if (checked) {
parent.debug('email', "Sending device notification to " + email);
if ((parent.certificates == null) || (parent.certificates.CommonName == null) || (parent.certificates.CommonName.indexOf('.') == -1)) {
parent.debug('email', "Error: Server name not set."); // If the server name is not set, email not possible.
return;
}
var template = getTemplate('device-notify', domain, language);
if ((template == null) || (template.htmlSubject == null) || (template.txtSubject == null)) {
parent.debug('email', "Error: Failed to get mail template."); // No email template found
return;
}
// Set all the template replacement options and generate the final email text (both in txt and html formats).
var optionsHtml = { username: username, email: email, servername: domain.title ? domain.title : 'MeshCentral', header: true, footer: false };
var optionsTxt = { username: username, email: email, servername: domain.title ? domain.title : 'MeshCentral', header: true, footer: false };
if ((connections == null) || (connections.length == 0)) {
optionsHtml.connections = false;
optionsTxt.connections = false;
} else {
optionsHtml.connections = connections.join('<br />\r\n');
optionsTxt.connections = connections.join('\r\n');
}
if ((disconnections == null) || (disconnections.length == 0)) {
optionsHtml.disconnections = false;
optionsTxt.disconnections = false;
} else {
optionsHtml.disconnections = disconnections.join('<br />\r\n');
optionsTxt.disconnections = disconnections.join('\r\n');
}
// Get from field
var from = null;
if (obj.config.sendgrid && (typeof obj.config.sendgrid.from == 'string')) { from = obj.config.sendgrid.from; }
else if (obj.config.smtp && (typeof obj.config.smtp.from == 'string')) { from = obj.config.smtp.from; }
// Send the email
obj.pendingMails.push({ to: email, from: from, subject: mailReplacements(template.htmlSubject, domain, optionsTxt), text: mailReplacements(template.txt, domain, optionsTxt), html: mailReplacements(template.html, domain, optionsHtml) });
sendNextMail();
}
});
};
// Send out the next mail in the pending list
function sendNextMail() {
if ((obj.sendingMail == true) || (obj.pendingMails.length == 0)) { return; }
@ -463,7 +510,7 @@ module.exports.CreateMeshMail = function (parent, domain) {
// Add the user and start a timer
if (obj.deviceNotifications[user._id] == null) {
obj.deviceNotifications[user._id] = { nodes: {} };
obj.deviceNotifications[user._id].timer = setTimeout(function () { sendDeviceNotifications(user._id); }, 20000);
obj.deviceNotifications[user._id].timer = setTimeout(function () { sendDeviceNotifications(user._id); }, 5 * 60 * 1000); // 5 minute before email is sent
}
// Add the device
@ -527,7 +574,7 @@ module.exports.CreateMeshMail = function (parent, domain) {
// Add the user and start a timer
if (obj.deviceNotifications[user._id] == null) {
obj.deviceNotifications[user._id] = { nodes: {} };
obj.deviceNotifications[user._id].timer = setTimeout(function () { sendDeviceNotifications(user._id); }, 20000);
obj.deviceNotifications[user._id].timer = setTimeout(function () { sendDeviceNotifications(user._id); }, 5 * 60 * 1000); // 5 minute before email is sent
}
// Add the device
@ -617,9 +664,16 @@ module.exports.CreateMeshMail = function (parent, domain) {
connections.sort(sortCollator.compare);
disconnections.sort(sortCollator.compare);
// TODO: Send the email
//console.log('sendDeviceNotifications', connections, disconnections);
// Get the user and domain
const user = parent.webserver.users[userid];
if ((user == null) || (user.email == null) || (user.emailVerified !== true)) return;
const domain = obj.parent.config.domains[user.domain];
if (domain == null) return;
// Send the email
obj.sendDeviceNotifyMail(domain, user.name, user.email, connections, disconnections, 'us-en', null);
// Clean up
delete obj.deviceNotifications[userid];
}

View File

@ -36,8 +36,6 @@
"sample-config-advanced.json"
],
"dependencies": {
"archiver": "^4.0.2",
"archiver-zip-encrypted": "^1.0.10",
"body-parser": "^1.19.0",
"cbor": "~5.2.0",
"compression": "^1.7.4",
@ -45,24 +43,13 @@
"express": "^4.17.0",
"express-handlebars": "^3.1.0",
"express-ws": "^4.0.0",
"image-size": "^1.0.0",
"ipcheck": "^0.1.0",
"loadavg-windows": "^1.1.1",
"minimist": "^1.2.0",
"mongodb": "^4.1.0",
"multiparty": "^4.2.1",
"nedb": "^1.8.0",
"node-forge": "^0.10.0",
"node-rdpjs-2": "^0.3.5",
"node-windows": "^1.0.0-beta.6",
"nodemailer": "^6.6.5",
"otplib": "^10.2.3",
"saslprep": "^1.0.3",
"ssh2": "^1.4.0",
"web-push": "^3.4.5",
"ws": "^5.2.3",
"yauzl": "^2.10.0",
"yubikeyotp": "^0.2.0"
"yauzl": "^2.10.0"
},
"repository": {
"type": "git",

View File

@ -44,11 +44,13 @@ var meshCentralSourceFiles = [
"../emails/account-login.html",
"../emails/account-reset.html",
"../emails/mesh-invite.html",
"../emails/device-notify.html",
"../emails/account-check.txt",
"../emails/account-invite.txt",
"../emails/account-login.txt",
"../emails/account-reset.txt",
"../emails/mesh-invite.txt",
"../emails/device-notify.txt",
"../emails/sms-messages.txt",
'../agents/agent-translations.json'
];

View File

@ -14242,6 +14242,13 @@
"default.handlebars->37->2673"
]
},
{
"en": "Connected devices:",
"xloc": [
"device-notify.html->2->5->1",
"device-notify.txt"
]
},
{
"cs": "Připojeno hned",
"de": "Jetzt verbunden",
@ -19269,6 +19276,13 @@
"xterm.handlebars->9->1"
]
},
{
"en": "Disconnected devices:",
"xloc": [
"device-notify.html->2->7->1",
"device-notify.txt"
]
},
{
"cs": "Zavrhnout",
"de": "Verwerfen",
@ -56354,6 +56368,13 @@
"default.handlebars->37->1590"
]
},
{
"en": "The folloing devices have changed their connection state.",
"xloc": [
"device-notify.html->2->3->1",
"device-notify.txt"
]
},
{
"cs": "Níže jsou uvedena požadovaná zveřejnění součástí a softwaru s otevřeným zdrojovým kódem začleněných do tohoto softwaru.",
"de": "Im Folgenden sind die erforderlichen Angaben zu Open Source-Komponenten und -Software aufgeführt, die in dieser Software enthalten sind.",
@ -57612,6 +57633,18 @@
"agentinvite.handlebars->container->column_l->5->linuxtab->9"
]
},
{
"en": "To unsubscribe,",
"xloc": [
"device-notify.html->2->9->1"
]
},
{
"en": "To unsubscribe, load this link within 1 hour of getting this message: [[[SERVERURL]]][[[UNSUBSCRIBELINK]]]",
"xloc": [
"device-notify.txt"
]
},
{
"cs": "Oznámení přípitku",
"de": "Toastbenachrichtigung",
@ -64580,6 +64613,18 @@
"sms-messages.txt"
]
},
{
"en": "[[[CONNECTIONS]]]",
"xloc": [
"device-notify.html->2->5->3->0"
]
},
{
"en": "[[[DISCONNECTIONS]]]",
"xloc": [
"device-notify.html->2->7->3->0"
]
},
{
"cs": "[[[SERVERNAME]]]",
"de": "[[[SERVERNAME]]]",
@ -64707,6 +64752,14 @@
"mesh-invite.html->2->1->1->0->1->1"
]
},
{
"en": "[[[SERVERNAME]]] - Device Notification",
"xloc": [
"device-notify.html->0",
"device-notify.html->2->1->1->0->1->1",
"device-notify.txt"
]
},
{
"cs": "[[[SERVERNAME]]] - Ověření e-mailem",
"de": "[[[SERVERNAME]]] - E-Mail-Überprüfung",
@ -65149,6 +65202,7 @@
"zh-chs": "点击这里",
"zh-cht": "點擊這裡",
"xloc": [
"device-notify.html->2->9->1->1",
"mesh-invite.html->2->15->1->1"
]
},
@ -67022,6 +67076,12 @@
"zh-chs": "v0.8.0",
"zh-cht": "v0.8.0"
},
{
"en": "within 1 hour of getting this message.",
"xloc": [
"device-notify.html->2->9->1"
]
},
{
"cs": "{0}",
"de": "{0}",