File: D:/bin/scripts/OrderProgressEmails.vbs
' (SS,05/07/16) order progress emails run at a scheduled time (see Control Panel for actual schedule)
' (SS,05/07/16) currently only applicable to CIRC, added www.castironradiatorcentre.co.uk
' (SS,20/12/23) added cmd=do to the URL
AddLog ""
' Call SendOrderProgressEmails("https://www.castironradiatorcentre.co.uk")
' (SS,27/8/25) replaced above with following, due to new CIRC site, "itp." is the legacy site
Call SendOrderProgressEmails("https://itp.castironradiatorcentre.co.uk")
Sub SendOrderProgressEmails(AWebsite)
On Error Resume Next
Dim objRequest
Dim LURL
Set objRequest = CreateObject("Microsoft.XMLHTTP")
' (SS,11/12/15) removed "http://" prefix because URL now contains it
' (SS,20/11/23) added ?cmd=do (for safety purposes due to adding a sample mode i.e. cmd=sample)
LURL = AWebsite + "/order-progress-emails.asp?cmd=do"
AddLog "1. Started: " & LURL
objRequest.open "GET", LURL, False
objRequest.send
AddLog "2. Finished: " & LURL
Set objRequest = Nothing
End Sub
Sub AddLog(AMessage)
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("D:\Logs\Order Progress Emails\OrderProgressEmailsLog.txt", 8, True)
f.WriteLine(Now & " - " & AMessage)
f.Close
Set f = Nothing
Set fs = Nothing
End Sub