From 2e64b97888c5c2a9c82a0ec7d618825db40c05c8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 9 Oct 2018 15:54:44 +0200 Subject: sms-forward: use function for notification --- sms-forward | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sms-forward b/sms-forward index 76bc1f7..70699c0 100644 --- a/sms-forward +++ b/sms-forward @@ -8,6 +8,8 @@ :global "email-general-to"; :global "email-general-cc"; +:global SendNotification; + # check mail server :if ([ / tool netwatch get [ find where comment=[ / tool e-mail get address ] ] status ] != "up") do={ :error "Mail server is not up."; @@ -26,9 +28,8 @@ :if ($phone = $allowed && message~("^:cmd " . $secret . " script ")) do={ :log debug "Ignoring SMS, which starts a script."; } else={ - / tool e-mail send to=$"email-general-to" cc=$"email-general-cc" \ - subject=("[" . $identity . "] SMS Forwarding") \ - body=("A message was received by " . $identity . ":\n\n" . \ + $SendNotification ("[" . $identity . "] SMS Forwarding") \ + ("A message was received by " . $identity . ":\n\n" . \ "Phone: " . $phone . "\n" . \ "Timestamp: " . $timestamp . "\n" . \ "Type: " . $type . "\n\n" . \ -- cgit v1.2.3-70-g09d2