Current location: Hot Scripts Forums » Programming Languages » PHP » How to delay an email response if no user action?


How to delay an email response if no user action?

Reply
  #1 (permalink)  
Old 08-05-06, 09:08 AM
uberdragon uberdragon is offline
New Member
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
How to delay an email response if no user action?

Hello all first I'll detail the project at hand:

I'm writing landing pages for advertisement content in flash. The flash content will capture name and email information and then send the surfer to my landing pages to be encoded in PHP. I will capture the data sent via POST and that should consist of name and email at the very least.

The question presented to me is:

If the user abandons the landing page (doesn't fill in the additional info) is there a way to automatically email that surfer (based on the email information passed from the Flash ad). They would like this email to be generated 24 hours after receiving the data from the initial advertisement only if the user didn't continue to the remaining pages.

I've been grappling with the concept and how I would handle this. Making things happen based on user input is easy. But this needs to react if NO user interaction happens.

I have considered simply placing the data sent from the advert in a database for storage, if the user completes the additional form on the landing pages it would complete the data row in the database. I could then check to see if all data was filled in and if the database row only holds name and email, generate an email to the recipient.

The only way I can think of to initiate the checking of data to see how far the surfer got is by the next person to access the landing page. (each time the landing page is viewed it runs a check of the database fields, if it finds only name and email, it fires of the hello email to surfer and then fills in another field in the row such as: Emailed to TRUE causing the next refresh to not email that data row again).

This ofcourse relies on the next refresh to initiate the check of db data and I would imagine could cause things to get very slow as that database fills up. And it doesn't delay the email generation by 24 hours as requested.

Any suggestions ideas? I'm not looking for code neccesarily just a concept on how to make this happen in the most efficient manner. I look forward to your comments.

~Shane
__________________
My Latest Pet Project
My WebHoster
Reply With Quote
  #2 (permalink)  
Old 08-05-06, 09:27 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Probably the most straight forward way would be to initially store the data in its own table in the database, with a column that holds a timestamp/datetime when they first submitted the data. When they complete the sign up and enter all the data, delete their row from this first table and insert the complete data in the final table.

To get the 24 hour emails to be sent, you need to use a cron job/scheduled task (depending on operating system), running once per hour, to run a web page script that queries the first table for any timestamp/datetime that is 24 hours or older... You probably also want this script to cleanup the first table by deleting entries that are older than some maximum age and/or it could produce a report email to an "administrator" with info on those that started the sign up but did not complete it...
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help email user question ahowardmiller PHP 2 04-18-06 07:59 PM
2 flash websites for sale metamorph General Advertisements 5 01-09-05 10:03 PM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 06:02 AM


All times are GMT -5. The time now is 07:23 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.