How to trigger an email when reaching certain date?
I have a recordset with an expiration date for customers and i want UE to auto send an email five days before reaching the expiration date.
thanks for your help,
Jim Balthrop
I have a recordset with an expiration date for customers and i want UE to auto send an email five days before reaching the expiration date.
thanks for your help,
Jim Balthrop
Universal Email will create the script that will send the email for you but it will be up to you to create the other parts of this. I think you should start out with a page that has a recordset on it that selects all the customers who expire in five days. You would then use Universal Email to setup the message and send it to everyone in the recordset.
To automate this you will need to setup a chron job or scheduled task depending on your server environment. Both of these would work the same way, you preconfigure the settings of what script you want to run (the page) and when. You should do this daily so that you everyone gets an early warning about the expiration.
Thanks Eric,
I have it set up and set UE to send email to all in the recordset with the trigger 'recordset not empty'
Does just what i want.
Have another question-
If i set a cron job to open the page (which sends the email) daily, is there a way to not send to a person in the recordset, if they had an email yesterday. In effect so that once they receive an email, it won't send them again?
Having it setup like this would be a little tricker since the script itself does not know if an email has been sent to a certain person. You would need to control this with the rs query so that it did not select any user's that have had the email sent recently.
To do something like this you could update the records that you have sent the email to so that it indicates the message was sent. Then when you query the db you will need to filter these users out so that they do not appear in the recordset again. This would be a very custom piece though.
Another way you could do this would be to tighten up the query so that it only sends emails to user's that are a certain number of days away from expiring. For example if you had 5 users and three of them expire in 5 days, and the other two expire in six days you can have the query select only the users who expire in 5 days. This would send to the the three example workers whose expiration date is 5 days away but it would not send to the other two who expire in 6 days. When you run this same query 24 hours later there should only be two matches and they would get their email while the others remain untouched.
I think this is the best way to go about it, then you do not have to account for others that may have already received the email.
Eric,
thanks for your response.
Great idea about query for just accounts that are 5 days from expiration; works great and only sends the email once since i am running the page just once per day.
I could not get the cron set up properly to run once per day but i used windows task scheduler to open the url once per day and it finds the qualifying accounts and UE sends the email.
Great!
Hi
Have been watching your post with interest as this is something I am looking to do. I have never used Windows Task Manager before and wondered if you could shed some light as to how you set this up?
Thanks Jo
i have windows 7
go to Control Panel > Administrative Tools > Task Scheduler
Click 'Create Task'
Tabs are General, Triggers, Actions, Conditions, Settings
Action to open URL -
"C:\Program Files\Internet Explorer\IEXPLORE.EXE" www.mydomain.com/[and then page you want to open]
Triggers is time of day, daily, weekly, etc.
The page opened has a recordset that GETS record of any customer expiring in 5 days.
UE trigger is 'recordset not empty'
If there is a customer expiring in 5 days, UE sends the notice of expiration to the customer/customers and then redirects to a page that lists the customers that were sent the email.
the URL remains open on my PC until i close it.
I have it run daily at 10:30pm
Jim Balthrop
Brilliant Jim, Thank you so much for taking the time to explain that. That is just what I needed.
Jo
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.