Delay as variable

This commit is contained in:
Pothi Kalimuthu 2025-12-22 10:11:48 +05:30
parent 21c3b39845
commit 90f495761c
No known key found for this signature in database
GPG key ID: 57069303D36E3093

View file

@ -13,6 +13,8 @@
# Note: The SMS is removed from the inbox after sent by Email and forwarded # Note: The SMS is removed from the inbox after sent by Email and forwarded
# even if email and forward fail! So, test it often! # even if email and forward fail! So, test it often!
:local delayDuration 5s
:global adminEmail :global adminEmail
:if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={ :if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={
:log error "adminEmail is not defined or nil."; :error "Error: Check the log"; } :log error "adminEmail is not defined or nil."; :error "Error: Check the log"; }
@ -39,12 +41,13 @@
:do { :do {
/tool sms send lte1 phone-number=$smsForwardPh message=$smsMessage /tool sms send lte1 phone-number=$smsForwardPh message=$smsMessage
} on-error={ /tool e-mail send to="$adminEmail" subject="Sending SMS Failed" body="Check the log" } } on-error={ /tool e-mail send to="$adminEmail" subject="Sending SMS Failed" body="Check the log" }
:delay 2s :delay delayDuration
# Send Email to $adminEmail # Send Email to $adminEmail
/tool e-mail send to="$adminEmail" body="$smsMessage" \ /tool e-mail send to="$adminEmail" body="$smsMessage" \
subject="SMS from $smsPhone at $smsTimeStamp" subject="SMS from $smsPhone at $smsTimeStamp"
:delay 3s :delay delayDuration
remove $i remove $i
:delay delayDuration
} }