close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to trigger an email when reaching certain date?

Thread began 12/18/2009 7:35 pm by JBWebWorks | Last modified 1/01/2010 11:45 am by JBWebWorks | 1341 views | 8 replies |

JBWebWorks

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

Sign in to reply to this post

Eric Mittman

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.

Sign in to reply to this post

JBWebWorks

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?

Sign in to reply to this post

Eric Mittman

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.

Sign in to reply to this post

JBWebWorks

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!

Sign in to reply to this post

jo4koalas392067

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

Sign in to reply to this post

JBWebWorks

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

Sign in to reply to this post

jo4koalas392067

Brilliant Jim, Thank you so much for taking the time to explain that. That is just what I needed.

Jo

Sign in to reply to this post

JBWebWorks

You're welcome, Mate.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...