aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2018-11-27 14:08:14 +0100
committerGravatar Christian Hesse <mail@eworm.de>2018-11-28 21:19:39 +0100
commit6e4d7159378259a521e467504509de871381d078 (patch)
tree9fcf9938cbf64949f5022a268b9249e3b0cbba17 /global-functions
parentc4f8c1ad52cd629f39009848610d31b320bfda03 (diff)
global-functions: add identity tag in $SendNotification
... and send subject in telegram message.
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions6
1 files changed, 4 insertions, 2 deletions
diff --git a/global-functions b/global-functions
index 5f38150..ff689d8 100644
--- a/global-functions
+++ b/global-functions
@@ -61,6 +61,7 @@
:local message [ :tostr $2 ];
:local attach [ :tostr $3 ];
+ :global "identity";
:global "email-general-to";
:global "email-general-cc";
:global "telegram-tokenid";
@@ -72,7 +73,7 @@
:if ([ :len $"email-general-to" ] > 0) do={
:do {
/ tool e-mail send to=$"email-general-to" cc=$"email-general-cc" \
- subject=$subject body=$message file=$attach;
+ subject=("[" . $"identity" . "] " . $subject) body=$message file=$attach;
} on-error={
:log warning "Failed sending notification mail!";
}
@@ -83,7 +84,8 @@
:do {
/ tool fetch check-certificate=yes-without-crl keep-result=no http-method=post \
("https://api.telegram.org/bot" . $"telegram-tokenid" . "/sendMessage") \
- http-data=("chat_id=" . $"telegram-chatid" . "&text=" . [ $UrlEncode $message ]);
+ http-data=("chat_id=" . $"telegram-chatid" . "&text=" . \
+ [ $UrlEncode ("[" . $"identity" . "] " . $subject . "\n\n" . $message) ]);
} on-error={
:log warning "Failed sending telegram notification!";
}