sms-forward: use function for notification

This commit is contained in:
Christian Hesse 2018-10-09 15:54:44 +02:00
parent e6c217aa0c
commit 2e64b97888

View file

@ -8,6 +8,8 @@
:global "email-general-to"; :global "email-general-to";
:global "email-general-cc"; :global "email-general-cc";
:global SendNotification;
# check mail server # check mail server
:if ([ / tool netwatch get [ find where comment=[ / tool e-mail get address ] ] status ] != "up") do={ :if ([ / tool netwatch get [ find where comment=[ / tool e-mail get address ] ] status ] != "up") do={
:error "Mail server is not up."; :error "Mail server is not up.";
@ -26,9 +28,8 @@
:if ($phone = $allowed && message~("^:cmd " . $secret . " script ")) do={ :if ($phone = $allowed && message~("^:cmd " . $secret . " script ")) do={
:log debug "Ignoring SMS, which starts a script."; :log debug "Ignoring SMS, which starts a script.";
} else={ } else={
/ tool e-mail send to=$"email-general-to" cc=$"email-general-cc" \ $SendNotification ("[" . $identity . "] SMS Forwarding") \
subject=("[" . $identity . "] SMS Forwarding") \ ("A message was received by " . $identity . ":\n\n" . \
body=("A message was received by " . $identity . ":\n\n" . \
"Phone: " . $phone . "\n" . \ "Phone: " . $phone . "\n" . \
"Timestamp: " . $timestamp . "\n" . \ "Timestamp: " . $timestamp . "\n" . \
"Type: " . $type . "\n\n" . \ "Type: " . $type . "\n\n" . \