diff options
author | Christian Hesse <mail@eworm.de> | 2023-12-04 22:21:51 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-12-05 00:11:19 +0100 |
commit | d3611cebbd6ae725b209bbc82a65751d8e8f5770 (patch) | |
tree | 066e77e26c24274efff1875ade050e67c622a6c8 /mod/notification-email.rsc | |
parent | 9fb596135e335f0ca4cfc1a8ad6047b58ba319d5 (diff) |
mod/notification-email: $NotificationFunctions->"email": support hook for signature
You can compose your own signature by creating a function:
:global NotificationEMailSignature do={
:global EitherOr;
:local RouterBoard [ /system/routerboard/get ];
:return ( \
[ $EitherOr ($RouterBoard->"board-name") ($RouterBoard->"model") ] . " s/n " . $RouterBoard->"serial-number" . " | " . \
"RouterOS " . [ /system/package/update/get installed-version ] . " | " . \
"IP " . [ /ip/cloud/get public-address ]);
}
Diffstat (limited to 'mod/notification-email.rsc')
-rw-r--r-- | mod/notification-email.rsc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index e10353c..5d5aed1 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -131,6 +131,7 @@ :global EitherOr; :global IfThenElse; + :global NotificationEMailSignature; :global NotificationEMailSubject; :local To [ $EitherOr ($EmailGeneralToOverride->($Notification->"origin")) $EmailGeneralTo ]; @@ -144,7 +145,7 @@ :if ([ :typeof $EmailQueue ] = "nothing") do={ :set EmailQueue ({}); } - :local Signature [ /system/note/get note ]; + :local Signature [ $EitherOr [ $NotificationEMailSignature ] [ /system/note/get note ] ]; :set ($EmailQueue->[ :len $EmailQueue ]) { to=$To; cc=$Cc; subject=[ $NotificationEMailSubject ($Notification->"subject") ]; |