Just purchased Ascendis.
I having a problem on trying to figure out how to set between times.
I'm wanting to do this.
If timenow >= "something" and timenow <= "something"
sendemail
endif
In another words, I wish to sendemail only between certain hours.
Thanks,
JT
Using time in script editor
Re: Using time in script editor
Hello JT,
Here is a script that sends an email only between the hours of 8 am and 5 pm:
To use it, create a new category (if you haven't already) and change the Action Type to Advanced. Then paste the above code into the script. This is a complete script by itself, or you can add it to an existing script.
You will have to change the from and recipient email addresses appropriately. You can easily change the times by changing the '8 am' and '5 pm' accordingly.
If you created a new category for the action, don't forget to change the "Category for new callers" in the General page of the Options window to use the new category, if you want it to work for most callers.
If you need the action to do something else, let me know!
Finest regards,
Bill Root
Here is a script that sends an email only between the hours of 8 am and 5 pm:
Code: Select all
//LANGUAGE=DWS
if (Time > StrToTime('8 am')) and (Time < StrToTime('5 pm')) then
begin
SendMail(
// from email address
'myemail@myisp.com',
// recipient email address
'mycellphone@mycellularprovider.com',
// subject
'Call from ' + CallInfo.Name + ' at ' + CallInfo.Number,
// message
'Call received on line ' + CallInfo.Line);
end;
You will have to change the from and recipient email addresses appropriately. You can easily change the times by changing the '8 am' and '5 pm' accordingly.
If you created a new category for the action, don't forget to change the "Category for new callers" in the General page of the Options window to use the new category, if you want it to work for most callers.
If you need the action to do something else, let me know!
Finest regards,
Bill Root