In my web application, after the user makes a purchase, he has to register with us within next 30 days. So I need to send him an email every week for 30 days, till he registers. After he registers, I need to stop sending the email.
I have the VB script file to run the code which would send the email (attached)
I know I can create a job and set a recurring time in Management -> SQL Server Agent ->Jobs.
But how do I set the time dynamically, as and when a user makes a purchase? Then I need to stop the emails once the user registers. Can you please take me in the right direction?
SET objRequest= CreateObject("Microsoft.XMLHTTP")
URL = "http://server/project/EmailSchld.aspx"
objRequest.Open "POST", URL, False
objRequest.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
Set ObjRequest = Nothing